You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sirona.apache.org by ol...@apache.org on 2013/11/19 01:52:43 UTC

svn commit: r1543274 - /incubator/sirona/trunk/core/src/main/java/org/apache/sirona/gauges/jvm/ActiveThreadGauge.java

Author: olamy
Date: Tue Nov 19 00:52:43 2013
New Revision: 1543274

URL: http://svn.apache.org/r1543274
Log:
better with adding file

Added:
    incubator/sirona/trunk/core/src/main/java/org/apache/sirona/gauges/jvm/ActiveThreadGauge.java   (with props)

Added: incubator/sirona/trunk/core/src/main/java/org/apache/sirona/gauges/jvm/ActiveThreadGauge.java
URL: http://svn.apache.org/viewvc/incubator/sirona/trunk/core/src/main/java/org/apache/sirona/gauges/jvm/ActiveThreadGauge.java?rev=1543274&view=auto
==============================================================================
--- incubator/sirona/trunk/core/src/main/java/org/apache/sirona/gauges/jvm/ActiveThreadGauge.java (added)
+++ incubator/sirona/trunk/core/src/main/java/org/apache/sirona/gauges/jvm/ActiveThreadGauge.java Tue Nov 19 00:52:43 2013
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sirona.gauges.jvm;
+
+import org.apache.sirona.Role;
+import org.apache.sirona.counters.Unit;
+import org.apache.sirona.gauges.Gauge;
+
+import java.lang.management.ManagementFactory;
+import java.lang.management.OperatingSystemMXBean;
+
+public class ActiveThreadGauge implements Gauge {
+    public static final Role ACTIVE_THREAD = new Role("Active Thread", Unit.UNARY);
+
+    @Override
+    public Role role() {
+        return ACTIVE_THREAD;
+    }
+
+    @Override
+    public double value() {
+        return Thread.activeCount();
+    }
+}

Propchange: incubator/sirona/trunk/core/src/main/java/org/apache/sirona/gauges/jvm/ActiveThreadGauge.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/sirona/trunk/core/src/main/java/org/apache/sirona/gauges/jvm/ActiveThreadGauge.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision