commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nico...@apache.org
Subject svn commit: r679034 [1/2] - in /commons/sandbox/monitoring/trunk: ./ src/main/java/org/apache/commons/monitoring/ src/main/java/org/apache/commons/monitoring/impl/metrics/ src/main/java/org/apache/commons/monitoring/impl/monitors/ src/main/java/org/apa...
Date Wed, 23 Jul 2008 09:00:23 GMT
Author: nicolas
Date: Wed Jul 23 02:00:21 2008
New Revision: 679034

URL: http://svn.apache.org/viewvc?rev=679034&view=rev
Log:
rename "statValue" to "metric"

Added:
    commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/Metric.java   (contents, props changed)
      - copied, changed from r663070, commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/StatValue.java
    commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/impl/metrics/   (props changed)
      - copied from r663070, commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/impl/values/
    commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/impl/metrics/AbstractMetric.java
      - copied, changed from r663070, commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/impl/values/AbstractStatValue.java
    commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/impl/monitors/CompositeMetricsMonitor.java
      - copied, changed from r663070, commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/impl/monitors/CompositeValuesMonitor.java
    commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/impl/monitors/CreateMetricsOnDemandMonitor.java
      - copied, changed from r663070, commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/impl/monitors/CreateValuesOnDemandMonitor.java
    commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/servlet/jsp/MetricTag.java   (contents, props changed)
      - copied, changed from r663070, commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/servlet/jsp/StatValueTag.java
    commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/support/jaxws/
    commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/support/jaxws/PerformancesHandler.java   (with props)
    commons/sandbox/monitoring/trunk/src/main/webapp/META-INF/
    commons/sandbox/monitoring/trunk/src/main/webapp/test.jsp   (with props)
    commons/sandbox/monitoring/trunk/src/test/java/org/apache/commons/monitoring/impl/CompositeMetricsMonitorTest.java   (contents, props changed)
      - copied, changed from r679011, commons/sandbox/monitoring/trunk/src/test/java/org/apache/commons/monitoring/impl/CompositeValuesMonitorTest.java
Removed:
    commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/StatValue.java
    commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/impl/metrics/AbstractStatValue.java
    commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/impl/monitors/CompositeValuesMonitor.java
    commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/impl/monitors/CreateValuesOnDemandMonitor.java
    commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/impl/values/
    commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/servlet/jsp/StatValueTag.java
    commons/sandbox/monitoring/trunk/src/test/java/org/apache/commons/monitoring/impl/CompositeValuesMonitorTest.java
Modified:
    commons/sandbox/monitoring/trunk/pom.xml
    commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/Counter.java
    commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/Gauge.java
    commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/Monitor.java
    commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/Repository.java
    commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/Role.java
    commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/impl/metrics/CompositeCounter.java
    commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/impl/metrics/CompositeGauge.java
    commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/impl/metrics/ThreadSafeCounter.java
    commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/impl/metrics/ThreadSafeGauge.java
    commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/impl/monitors/AbstractMonitor.java
    commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/impl/monitors/ObservableMonitor.java
    commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/impl/repositories/DefaultRepository.java
    commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/listeners/SecondaryMonitor.java
    commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/listeners/ThresholdListener.java
    commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/reporting/AbstractRenderer.java
    commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/reporting/FlotRenderer.java
    commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/reporting/HtmlRenderer.java
    commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/reporting/JsonRenderer.java
    commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/reporting/Selector.java
    commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/reporting/SelectorPeriodicLogger.java
    commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/reporting/TxtRenderer.java
    commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/reporting/XmlRenderer.java
    commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/reporting/web/NiceHtmlRenderer.java
    commons/sandbox/monitoring/trunk/src/main/resources/META-INF/monitoring.tld
    commons/sandbox/monitoring/trunk/src/site/xdoc/instrumentation.xml
    commons/sandbox/monitoring/trunk/src/site/xdoc/listeners.xml
    commons/sandbox/monitoring/trunk/src/site/xdoc/tutorial.xml
    commons/sandbox/monitoring/trunk/src/test/java/org/apache/commons/monitoring/impl/ThreadSafeCounterTest.java
    commons/sandbox/monitoring/trunk/src/test/java/org/apache/commons/monitoring/impl/ThreadSafeGaugeTest.java
    commons/sandbox/monitoring/trunk/src/test/java/org/apache/commons/monitoring/listener/ThresholdListenerTest.java
    commons/sandbox/monitoring/trunk/src/test/java/org/apache/commons/monitoring/reporting/RendererTest.java

Modified: commons/sandbox/monitoring/trunk/pom.xml
URL: http://svn.apache.org/viewvc/commons/sandbox/monitoring/trunk/pom.xml?rev=679034&r1=679033&r2=679034&view=diff
==============================================================================
--- commons/sandbox/monitoring/trunk/pom.xml (original)
+++ commons/sandbox/monitoring/trunk/pom.xml Wed Jul 23 02:00:21 2008
@@ -17,7 +17,7 @@
 -->
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
-		                http://maven.apache.org/maven-v4_0_0.xsd">
+                    http://maven.apache.org/maven-v4_0_0.xsd">
   <modelVersion>4.0.0</modelVersion>
   <parent>
     <groupId>org.apache.commons</groupId>
@@ -85,6 +85,20 @@
       <version>2.3</version>
       <scope>test</scope>
     </dependency>
+    <!--
+    <dependency>
+      <groupId>javax.xml.ws</groupId>
+      <artifactId>jaxws-api</artifactId>
+      <version>2.0</version>
+      <optional>true</optional>
+    </dependency>
+    <dependency>
+      <groupId>javax.xml.soap</groupId>
+      <artifactId>saaj-api</artifactId>
+      <version>1.3</version>
+      <optional>true</optional>
+    </dependency>
+     -->
   </dependencies>
   <developers>
     <developer>
@@ -101,11 +115,11 @@
     <url>http://svn.apache.org/viewvc/commons/sandbox/monitoring/trunk/</url>
   </scm>
   <build>
-  	<resources>
-  	  <resource>
-  	    <directory>${basedir}/src/main/resources</directory>
-  	  </resource>
-  	</resources>
+    <resources>
+      <resource>
+        <directory>${basedir}/src/main/resources</directory>
+      </resource>
+    </resources>
     <plugins>
       <!-- TODO : investigate OSGi support
         <plugin>

Modified: commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/Counter.java
URL: http://svn.apache.org/viewvc/commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/Counter.java?rev=679034&r1=679033&r2=679034&view=diff
==============================================================================
--- commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/Counter.java (original)
+++ commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/Counter.java Wed Jul 23 02:00:21 2008
@@ -24,7 +24,7 @@
  * @author <a href="mailto:nicolas@apache.org">Nicolas De Loof</a>
  */
 public interface Counter
-    extends StatValue
+    extends Metric
 {
 
     /**
@@ -39,7 +39,7 @@
     long getSum();
 
     /**
-     * @return how many time the value has been set
+     * @return how many time the Metric has been set
      */
     int getHits();
 

Modified: commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/Gauge.java
URL: http://svn.apache.org/viewvc/commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/Gauge.java?rev=679034&r1=679033&r2=679034&view=diff
==============================================================================
--- commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/Gauge.java (original)
+++ commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/Gauge.java Wed Jul 23 02:00:21 2008
@@ -18,11 +18,11 @@
 package org.apache.commons.monitoring;
 
 /**
- * A StatValue to expose application state, or resource consumption (open connections, active threads, ...)
+ * A Metric to expose application state, or resource consumption (open connections, active threads, ...)
  *
  * @author <a href="mailto:nicolas@apache.org">Nicolas De Loof</a>
  */
-public interface Gauge extends StatValue
+public interface Gauge extends Metric
 {
     void increment(Unit unit);
 

Copied: commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/Metric.java (from r663070, commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/StatValue.java)
URL: http://svn.apache.org/viewvc/commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/Metric.java?p2=commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/Metric.java&p1=commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/StatValue.java&r1=663070&r2=679034&rev=679034&view=diff
==============================================================================
--- commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/StatValue.java (original)
+++ commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/Metric.java Wed Jul 23 02:00:21 2008
@@ -19,16 +19,22 @@
 
 
 /**
- * A <code>StatValue</code> is a numerical indicator of some monitored
+ * A <code>Metric</code> is a numerical indicator of some monitored
  * application state with support for simple statistics.
  *
  * @author <a href="mailto:nicolas@apache.org">Nicolas De Loof</a>
  */
-public interface StatValue
+public interface Metric
 {
+    public enum type
+    {
+        COUNTER, GAUGE
+    };
+
+    type getType();
 
     /**
-     * @return the value
+     * @return the current value
      */
     long get();
 
@@ -38,7 +44,7 @@
     void set( long l, Unit unit );
 
     /**
-     * reset the statValue
+     * reset the Metric
      */
     void reset();
 
@@ -58,28 +64,28 @@
     double getMean();
 
     /**
-     * Compute the standard deviation : measures the dispersion of values around
-     * the average value = sqrt( variance ).
-     *
-     * @return the value standard deviation
+     * Compute the standard deviation : measures the dispersion of values around the average value = sqrt( variance ).
+     * 
+     * @return the Metric standard deviation
      */
     double getStandardDeviation();
 
     /**
-     * Set the monitor this value is attached to
+     * Set the monitor this Metric is attached to
+     * 
      * @param monitor
      */
     void setMonitor( Monitor monitor );
 
     /**
-     * @return the monitor this value is attached to
+     * @return the monitor this Metric is attached to
      */
     Monitor getMonitor();
 
     /**
-     * @return the role for this value in the monitor
+     * @return the role for this Metric in the monitor
      */
-    Role<? extends StatValue> getRole();
+    Role<? extends Metric> getRole();
 
     /**
      * @return the (primary) data unit
@@ -91,10 +97,11 @@
     void removeListener( Listener listener );
 
     /**
-     * Listener for StatValue events
+     * Listener for Metric events
      */
     public static interface Listener
     {
-        void onValueChanged( StatValue value, long l );
+        void onValueChanged( Metric value, long l );
     }
+
 }

Propchange: commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/Metric.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/Metric.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/Metric.java
------------------------------------------------------------------------------
    svn:mergeinfo = 

Modified: commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/Monitor.java
URL: http://svn.apache.org/viewvc/commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/Monitor.java?rev=679034&r1=679033&r2=679034&view=diff
==============================================================================
--- commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/Monitor.java (original)
+++ commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/Monitor.java Wed Jul 23 02:00:21 2008
@@ -19,35 +19,29 @@
 
 import java.util.Collection;
 
-
 /**
- * A <code>Monitor</code> is an abstraction of some application resource that
- * is instrumented with a set of indicators (Gauges or Counters).
+ * A <code>Monitor</code> is an abstraction of some application resource that is instrumented with a set of indicators
+ * (Gauges or Counters).
  * <p>
- * A Monitor is identified by its Key, that MUST be unique in the application.
- * To ensure this, the Key class defines the monitor identifier as a combination
- * of name, subsystem and category.
+ * A Monitor is identified by its Key, that MUST be unique in the application. To ensure this, the Key class defines the
+ * monitor identifier as a combination of name, subsystem and category.
  * <p>
- * The <tt>name</tt> is the human-readable representation of the "resource"
- * beeing monitored. A typical use is the fully qualified class name + method
- * signature, or the HTTP request path.
+ * The <tt>name</tt> is the human-readable representation of the "resource" beeing monitored. A typical use is the fully
+ * qualified class name + method signature, or the HTTP request path.
  * <p>
- * The <tt>category</tt> is a grouping attribute to reflect the application
- * layering. Typically for JEE application, you will set category to the N-tier
- * layer beeing monitored ("servlet", "service", "persistence").
+ * The <tt>category</tt> is a grouping attribute to reflect the application layering. Typically for JEE application, you
+ * will set category to the N-tier layer beeing monitored ("servlet", "service", "persistence").
  * <p>
- * The <tt>subsystem</tt> is a logical grouping, by use-cases. "account", and
- * "user" can be used as subsystem for the application account and user
- * management dedicated components.
+ * The <tt>subsystem</tt> is a logical grouping, by use-cases. "account", and "user" can be used as subsystem for the
+ * application account and user management dedicated components.
  * <p>
- * You are free to use more complex Key types, by simple subclassing the Key
- * class and providing the adequate equals()/hasCode() methods.
+ * You are free to use more complex Key types, by simple subclassing the Key class and providing the adequate
+ * equals()/hasCode() methods.
  * <p>
- * The Counters / Gauges used to store monitored application state are retrieved
- * based on a "role" String. The monitor can handle as many values as needed,
- * until any of them has a dedicated role. This allows to easily extend the
- * monitor by registering custom values.
- *
+ * The Counters / Gauges used to store monitored application state are retrieved based on a "role" String. The monitor
+ * can handle as many Metrics as needed, until any of them has a dedicated role. This allows to easily extend the
+ * monitor by registering custom Metrics.
+ * 
  * @author <a href="mailto:nicolas@apache.org">Nicolas De Loof</a>
  */
 public interface Monitor
@@ -103,36 +97,34 @@
     Gauge getGauge( Role<Gauge> role );
 
     /**
-     * Retrieve a StatValue.
+     * Retrieve a Metric.
      *
-     * @param role a unique identifier for a StatValue in the monitor
-     * @return the StatValue
+     * @param role a unique identifier for a Metric in the monitor
+     * @return the Metric
      */
-    StatValue getValue( String role );
+    Metric getMetric( String role );
 
     /**
-     * Retrieve a StatValue in the monitor
+     * Retrieve a Metric in the monitor
      *
-     * @param role the StatValue role in the monitor
-     * @return the StatValue
+     * @param role the Metric role in the monitor
+     * @return the Metric
      */
-    <T extends StatValue> T getValue( Role<T> role );
+    <T extends Metric> T getMetric( Role<T> role );
 
     /**
-     *
-     * @return an unmodifiable collection of registered statValues roles
+     * @return an unmodifiable collection of registered Metrics roles
      */
     @SuppressWarnings("unchecked")
     Collection<Role> getRoles();
 
     /**
-     *
-     * @return an unmodifiable collection of registered statValues
+     * @return an unmodifiable collection of registered Metrics
      */
-    Collection<StatValue> getValues();
+    Collection<Metric> getMetrics();
 
     /**
-     * Reset all StatValues (don't remove them)
+     * Reset all Metrics (don't remove them)
      */
     void reset();
 
@@ -266,7 +258,7 @@
      */
     public static interface Listener
     {
-        void onStatValueRegistered( StatValue value );
+        void onMetricRegistered( Metric metric );
     }
 
     /**

Modified: commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/Repository.java
URL: http://svn.apache.org/viewvc/commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/Repository.java?rev=679034&r1=679033&r2=679034&view=diff
==============================================================================
--- commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/Repository.java (original)
+++ commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/Repository.java Wed Jul 23 02:00:21 2008
@@ -79,8 +79,8 @@
     public static interface Listener
     {
         /**
-         * A monitor has just been created. Can be used to add custom StatValues or
-         * to register StatValue.Listener for all monitors that declare the same category or
+         * A monitor has just been created. Can be used to add custom Metrics or
+         * to register Metric.Listener for all monitors that declare the same category or
          * subsystem.
          *
          * @param monitor

Modified: commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/Role.java
URL: http://svn.apache.org/viewvc/commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/Role.java?rev=679034&r1=679033&r2=679034&view=diff
==============================================================================
--- commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/Role.java (original)
+++ commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/Role.java Wed Jul 23 02:00:21 2008
@@ -23,7 +23,7 @@
 import java.util.concurrent.ConcurrentHashMap;
 
 @SuppressWarnings("unchecked")
-public class Role<T extends StatValue>
+public class Role<T extends Metric>
     implements Comparable<Role>
 {
     private String name;
@@ -59,9 +59,9 @@
         {
             throw new IllegalArgumentException( "A type is required" );
         }
-        if ( !StatValue.class.isAssignableFrom( type ) )
+        if ( !Metric.class.isAssignableFrom( type ) )
         {
-            throw new IllegalArgumentException( "The type must extend StatValue" );
+            throw new IllegalArgumentException( "The type must extend Metric" );
         }
         this.name = name;
         this.unit = unit;

Propchange: commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/impl/metrics/
------------------------------------------------------------------------------
    svn:mergeinfo = 

Copied: commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/impl/metrics/AbstractMetric.java (from r663070, commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/impl/values/AbstractStatValue.java)
URL: http://svn.apache.org/viewvc/commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/impl/metrics/AbstractMetric.java?p2=commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/impl/metrics/AbstractMetric.java&p1=commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/impl/values/AbstractStatValue.java&r1=663070&r2=679034&rev=679034&view=diff
==============================================================================
--- commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/impl/values/AbstractStatValue.java (original)
+++ commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/impl/metrics/AbstractMetric.java Wed Jul 23 02:00:21 2008
@@ -15,24 +15,24 @@
  * limitations under the License.
  */
 
-package org.apache.commons.monitoring.impl.values;
+package org.apache.commons.monitoring.impl.metrics;
 
 import java.util.List;
 import java.util.concurrent.CopyOnWriteArrayList;
 
+import org.apache.commons.monitoring.Metric;
 import org.apache.commons.monitoring.Monitor;
 import org.apache.commons.monitoring.Role;
-import org.apache.commons.monitoring.StatValue;
 import org.apache.commons.monitoring.Unit;
 
 /**
- * A simple implementation of {@link StatValue}. Only provide methods to
+ * A simple implementation of {@link Metric}. Only provide methods to
  * compute stats from sum provided by derived classes.
  *
  * @author <a href="mailto:nicolas@apache.org">Nicolas De Loof</a>
  */
-public abstract class AbstractStatValue<T extends StatValue>
-    implements StatValue
+public abstract class AbstractMetric<T extends Metric>
+    implements Metric
 {
     private Monitor monitor;
 
@@ -48,7 +48,7 @@
 
     private List<Listener> listeners = new CopyOnWriteArrayList<Listener>();
 
-    public AbstractStatValue( Role<T> role )
+    public AbstractMetric( Role<T> role )
     {
         super();
         this.role = role;
@@ -131,14 +131,14 @@
         {
             return Double.NaN;
         }
-        double variance = ( getSquares() - getSum() * getMean() ) / ( n - 1 );
+        double variance = ( getSumOfSquares() - getSum() * getMean() ) / ( n - 1 );
         return Math.sqrt( Math.abs( variance ) );
     }
 
-    protected abstract long getSquares();
-
     public abstract long getSum();
 
+    protected abstract long getSumOfSquares();
+
     public int getHits()
     {
         return hits;

Modified: commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/impl/metrics/CompositeCounter.java
URL: http://svn.apache.org/viewvc/commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/impl/metrics/CompositeCounter.java?rev=679034&r1=663070&r2=679034&view=diff
==============================================================================
--- commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/impl/metrics/CompositeCounter.java (original)
+++ commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/impl/metrics/CompositeCounter.java Wed Jul 23 02:00:21 2008
@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 
-package org.apache.commons.monitoring.impl.values;
+package org.apache.commons.monitoring.impl.metrics;
 
 import java.util.Collection;
 import java.util.Collections;

Modified: commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/impl/metrics/CompositeGauge.java
URL: http://svn.apache.org/viewvc/commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/impl/metrics/CompositeGauge.java?rev=679034&r1=663070&r2=679034&view=diff
==============================================================================
--- commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/impl/metrics/CompositeGauge.java (original)
+++ commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/impl/metrics/CompositeGauge.java Wed Jul 23 02:00:21 2008
@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 
-package org.apache.commons.monitoring.impl.values;
+package org.apache.commons.monitoring.impl.metrics;
 
 import java.util.Collection;
 import java.util.Collections;

Modified: commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/impl/metrics/ThreadSafeCounter.java
URL: http://svn.apache.org/viewvc/commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/impl/metrics/ThreadSafeCounter.java?rev=679034&r1=663070&r2=679034&view=diff
==============================================================================
--- commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/impl/metrics/ThreadSafeCounter.java (original)
+++ commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/impl/metrics/ThreadSafeCounter.java Wed Jul 23 02:00:21 2008
@@ -15,20 +15,22 @@
  * limitations under the License.
  */
 
-package org.apache.commons.monitoring.impl.values;
+package org.apache.commons.monitoring.impl.metrics;
 
 import org.apache.commons.monitoring.Counter;
 import org.apache.commons.monitoring.Role;
 import org.apache.commons.monitoring.Unit;
 
 /**
- * Thread-safe implementation of <code>Counter</code>, based on
- * synchronized methods.
- *
+ * Thread-safe implementation of <code>Counter</code>, based on synchronized methods.
+ * <p>
+ * To reduce impact of synchronization, only the internal counter update is synchronized. Events dispatching is not and
+ * listeners must handle concurrency.
+ * 
  * @author <a href="mailto:nicolas@apache.org">Nicolas De Loof</a>
  */
 public class ThreadSafeCounter
-    extends AbstractStatValue<Counter>
+    extends AbstractMetric<Counter>
     implements Counter
 {
 
@@ -45,6 +47,16 @@
 
     /**
      * {@inheritDoc}
+     * 
+     * @see org.apache.commons.monitoring.Metric#getType()
+     */
+    public type getType()
+    {
+        return type.COUNTER;
+    }
+
+    /**
+     * {@inheritDoc}
      */
     public long get()
     {
@@ -75,14 +87,16 @@
     public void add( long delta, Unit unit )
     {
         delta = normalize( delta, unit );
-        synchronized ( this )
-        {
-            value += delta;
-            computeStats( delta );
-        }
+        threadSafeAdd( delta );
         fireValueChanged( delta );
     }
 
+    protected synchronized void threadSafeAdd( long delta )
+    {
+        value += delta;
+        computeStats( delta );
+    }
+
     @Override
     protected void computeStats( long l )
     {
@@ -97,8 +111,7 @@
         return ( (double) sum ) / getHits();
     }
 
-    @Override
-    protected long getSquares()
+    public long getSumOfSquares()
     {
         return sumOfSquares;
     }

Modified: commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/impl/metrics/ThreadSafeGauge.java
URL: http://svn.apache.org/viewvc/commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/impl/metrics/ThreadSafeGauge.java?rev=679034&r1=663070&r2=679034&view=diff
==============================================================================
--- commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/impl/metrics/ThreadSafeGauge.java (original)
+++ commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/impl/metrics/ThreadSafeGauge.java Wed Jul 23 02:00:21 2008
@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 
-package org.apache.commons.monitoring.impl.values;
+package org.apache.commons.monitoring.impl.metrics;
 
 import org.apache.commons.monitoring.Gauge;
 import org.apache.commons.monitoring.Role;
@@ -31,7 +31,7 @@
  * @author <a href="mailto:nicolas@apache.org">Nicolas De Loof</a>
  */
 public class ThreadSafeGauge
-    extends AbstractStatValue<Gauge>
+    extends AbstractMetric<Gauge>
     implements Gauge
 {
     private long value;
@@ -50,6 +50,16 @@
         super( role );
     }
 
+    /**
+     * {@inheritDoc}
+     * 
+     * @see org.apache.commons.monitoring.Metric#getType()
+     */
+    public type getType()
+    {
+        return type.GAUGE;
+    }
+
     public synchronized void reset()
     {
         // Don't reset value !
@@ -112,8 +122,7 @@
         return ( (double) sum ) / ( nanotime() - firstUse );
     }
 
-    @Override
-    protected long getSquares()
+    protected long getSumOfSquares()
     {
         return sumOfSquares;
     }

Modified: commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/impl/monitors/AbstractMonitor.java
URL: http://svn.apache.org/viewvc/commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/impl/monitors/AbstractMonitor.java?rev=679034&r1=679033&r2=679034&view=diff
==============================================================================
--- commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/impl/monitors/AbstractMonitor.java (original)
+++ commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/impl/monitors/AbstractMonitor.java Wed Jul 23 02:00:21 2008
@@ -24,9 +24,9 @@
 
 import org.apache.commons.monitoring.Counter;
 import org.apache.commons.monitoring.Gauge;
+import org.apache.commons.monitoring.Metric;
 import org.apache.commons.monitoring.Monitor;
 import org.apache.commons.monitoring.Role;
-import org.apache.commons.monitoring.StatValue;
 
 /**
  * Abstract {@link Monitor} implementation with implementation for base methods
@@ -37,7 +37,7 @@
 {
 
     @SuppressWarnings("unchecked")
-    private final ConcurrentMap<Role, StatValue> values;
+    private final ConcurrentMap<Role, Metric> metrics;
     private final Key key;
 
     @SuppressWarnings("unchecked")
@@ -45,7 +45,7 @@
     {
         super();
         this.key = key;
-        this.values = new ConcurrentHashMap<Role, StatValue>();
+        this.metrics = new ConcurrentHashMap<Role, Metric>();
     }
 
     /**
@@ -59,40 +59,40 @@
     /**
      * {@inheritDoc}
      */
-    public final StatValue getValue( String role )
+    public final Metric getMetric( String role )
     {
-        return values.get( role );
+        return metrics.get( role );
     }
 
     @SuppressWarnings("unchecked")
-    public final <T extends StatValue> T getValue( Role<T> role )
+    public final <T extends Metric> T getMetric( Role<T> role )
     {
-        return (T) values.get( role );
+        return (T) metrics.get( role );
     }
 
     @SuppressWarnings("unchecked")
     public final Collection<Role> getRoles()
     {
-        return Collections.unmodifiableCollection( values.keySet() );
+        return Collections.unmodifiableCollection( metrics.keySet() );
     }
 
-    public final Collection<StatValue> getValues()
+    public final Collection<Metric> getMetrics()
     {
-        return Collections.unmodifiableCollection( values.values() );
+        return Collections.unmodifiableCollection( metrics.values() );
     }
 
     /**
-     * Register a new StatValue in the monitor
-     *
-     * @param value StatValue instance to get registered
-     * @return a previously registered StatValue if existed, or <code>null</code>
-     * if value has been successfully registered
+     * Register a new Metric in the monitor
+     * 
+     * @param metric Metric instance to get registered
+     * @return a previously registered Metric if existed, or <code>null</code> if the metric has been successfully
+     * registered
      */
     @SuppressWarnings("unchecked")
-    protected <T extends StatValue> T register( T value )
+    protected <T extends Metric> T register( T metric )
     {
-        value.setMonitor( this );
-        return (T) values.putIfAbsent( value.getRole(), value );
+        metric.setMonitor( this );
+        return (T) metrics.putIfAbsent( metric.getRole(), metric );
     }
 
     /**
@@ -100,15 +100,15 @@
      */
     public void reset()
     {
-        for ( StatValue value : values.values() )
+        for ( Metric metric : metrics.values() )
         {
-            value.reset();
+            metric.reset();
         }
     }
 
     public Counter getCounter( Role<Counter> role )
     {
-        return getValue( role );
+        return getMetric( role );
     }
 
     @SuppressWarnings("unchecked")
@@ -119,7 +119,7 @@
 
     public Gauge getGauge( Role<Gauge> role )
     {
-        return getValue( role );
+        return getMetric( role );
     }
 
     @SuppressWarnings("unchecked")

Copied: commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/impl/monitors/CompositeMetricsMonitor.java (from r663070, commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/impl/monitors/CompositeValuesMonitor.java)
URL: http://svn.apache.org/viewvc/commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/impl/monitors/CompositeMetricsMonitor.java?p2=commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/impl/monitors/CompositeMetricsMonitor.java&p1=commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/impl/monitors/CompositeValuesMonitor.java&r1=663070&r2=679034&rev=679034&view=diff
==============================================================================
--- commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/impl/monitors/CompositeValuesMonitor.java (original)
+++ commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/impl/monitors/CompositeMetricsMonitor.java Wed Jul 23 02:00:21 2008
@@ -20,8 +20,8 @@
 import org.apache.commons.monitoring.Counter;
 import org.apache.commons.monitoring.Gauge;
 import org.apache.commons.monitoring.Role;
-import org.apache.commons.monitoring.impl.values.CompositeCounter;
-import org.apache.commons.monitoring.impl.values.CompositeGauge;
+import org.apache.commons.monitoring.impl.metrics.CompositeCounter;
+import org.apache.commons.monitoring.impl.metrics.CompositeGauge;
 
 /**
  * A Monitor implementation that creates
@@ -29,11 +29,11 @@
  *
  * @author <a href="mailto:nicolas@apache.org">Nicolas De Loof</a>
  */
-public class CompositeValuesMonitor
-    extends CreateValuesOnDemandMonitor
+public class CompositeMetricsMonitor
+    extends CreateMetricsOnDemandMonitor
 {
 
-    public CompositeValuesMonitor( Key key )
+    public CompositeMetricsMonitor( Key key )
     {
         super( key );
     }

Copied: commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/impl/monitors/CreateMetricsOnDemandMonitor.java (from r663070, commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/impl/monitors/CreateValuesOnDemandMonitor.java)
URL: http://svn.apache.org/viewvc/commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/impl/monitors/CreateMetricsOnDemandMonitor.java?p2=commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/impl/monitors/CreateMetricsOnDemandMonitor.java&p1=commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/impl/monitors/CreateValuesOnDemandMonitor.java&r1=663070&r2=679034&rev=679034&view=diff
==============================================================================
--- commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/impl/monitors/CreateValuesOnDemandMonitor.java (original)
+++ commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/impl/monitors/CreateMetricsOnDemandMonitor.java Wed Jul 23 02:00:21 2008
@@ -20,21 +20,21 @@
 import org.apache.commons.monitoring.Counter;
 import org.apache.commons.monitoring.Gauge;
 import org.apache.commons.monitoring.Role;
-import org.apache.commons.monitoring.impl.values.ThreadSafeCounter;
-import org.apache.commons.monitoring.impl.values.ThreadSafeGauge;
+import org.apache.commons.monitoring.impl.metrics.ThreadSafeCounter;
+import org.apache.commons.monitoring.impl.metrics.ThreadSafeGauge;
 
 /**
- * implementation of the <code>Monitor</code> interface that creates StatValues on
+ * implementation of the <code>Monitor</code> interface that creates Metrics on
  * demand. The application can request for Counters/Gauges without having to
- * handle instantiation of monitors with all required StatValues pre-registered.
+ * handle instantiation of monitors with all required Metrics pre-registered.
  *
  * @author <a href="mailto:nicolas@apache.org">Nicolas De Loof</a>
  */
-public class CreateValuesOnDemandMonitor
+public class CreateMetricsOnDemandMonitor
     extends ObservableMonitor
 {
 
-    public CreateValuesOnDemandMonitor( Key key )
+    public CreateMetricsOnDemandMonitor( Key key )
     {
         super( key );
     }
@@ -45,7 +45,7 @@
     @Override
     public Counter getCounter( Role<Counter> role )
     {
-        Counter counter = getValue( role );
+        Counter counter = getMetric( role );
         if ( counter != null )
         {
             return counter;
@@ -69,7 +69,7 @@
     @Override
     public Gauge getGauge( Role<Gauge> role )
     {
-        Gauge gauge = getValue( role );
+        Gauge gauge = getMetric( role );
         if ( gauge != null )
         {
             return gauge;

Modified: commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/impl/monitors/ObservableMonitor.java
URL: http://svn.apache.org/viewvc/commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/impl/monitors/ObservableMonitor.java?rev=679034&r1=679033&r2=679034&view=diff
==============================================================================
--- commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/impl/monitors/ObservableMonitor.java (original)
+++ commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/impl/monitors/ObservableMonitor.java Wed Jul 23 02:00:21 2008
@@ -20,8 +20,8 @@
 import java.util.List;
 import java.util.concurrent.CopyOnWriteArrayList;
 
+import org.apache.commons.monitoring.Metric;
 import org.apache.commons.monitoring.Monitor;
-import org.apache.commons.monitoring.StatValue;
 
 /**
  * <code>Monitor</code> implementation with support for listeners
@@ -47,23 +47,23 @@
     }
 
     /**
-     * Register the StatValue for the role, if none was registered before
-     *
-     * @param value
+     * Register the Metric for the role, if none was registered before
+     * 
+     * @param metric
      * @param role
-     * @return the value registered, or a previously existing one
+     * @return the registered metric, or a previously existing one for the role
      */
     @Override
-    protected <T extends StatValue> T register( T value )
+    protected <T extends Metric> T register( T metric )
     {
-        T previous = (T) super.register( value );
+        T previous = (T) super.register( metric );
         if ( previous != null )
         {
             return previous;
         }
         for ( Listener listener : listeners )
         {
-            listener.onStatValueRegistered( value );
+            listener.onMetricRegistered( metric );
         }
         return null;
     }

Modified: commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/impl/repositories/DefaultRepository.java
URL: http://svn.apache.org/viewvc/commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/impl/repositories/DefaultRepository.java?rev=679034&r1=679033&r2=679034&view=diff
==============================================================================
--- commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/impl/repositories/DefaultRepository.java (original)
+++ commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/impl/repositories/DefaultRepository.java Wed Jul 23 02:00:21 2008
@@ -18,7 +18,7 @@
 package org.apache.commons.monitoring.impl.repositories;
 
 import org.apache.commons.monitoring.StopWatch;
-import org.apache.commons.monitoring.impl.monitors.CompositeValuesMonitor;
+import org.apache.commons.monitoring.impl.monitors.CompositeMetricsMonitor;
 import org.apache.commons.monitoring.impl.stopwatches.DefaultStopWatch;
 
 /**
@@ -30,11 +30,11 @@
 {
     public DefaultRepository()
     {
-        super( DefaultStopWatch.class, CompositeValuesMonitor.class );
+        super( DefaultStopWatch.class, CompositeMetricsMonitor.class );
     }
 
     public DefaultRepository( Class<? extends StopWatch> stopwatchClass )
     {
-        super( stopwatchClass, CompositeValuesMonitor.class );
+        super( stopwatchClass, CompositeMetricsMonitor.class );
     }
 }

Modified: commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/listeners/SecondaryMonitor.java
URL: http://svn.apache.org/viewvc/commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/listeners/SecondaryMonitor.java?rev=679034&r1=679033&r2=679034&view=diff
==============================================================================
--- commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/listeners/SecondaryMonitor.java (original)
+++ commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/listeners/SecondaryMonitor.java Wed Jul 23 02:00:21 2008
@@ -18,17 +18,17 @@
 package org.apache.commons.monitoring.listeners;
 
 import org.apache.commons.monitoring.Composite;
+import org.apache.commons.monitoring.Metric;
 import org.apache.commons.monitoring.Monitor;
-import org.apache.commons.monitoring.StatValue;
 import org.apache.commons.monitoring.impl.monitors.AbstractMonitor;
 
 /**
- * A Monitor implementation that maintains a set of secondary StatValues in sync
+ * A Monitor implementation that maintains a set of secondary Metrics in sync
  * with the primary monitor. Register itself as a monitor listener to get notified
- * on new StatValues and automatically create the required secondary.
+ * on new Metrics and automatically create the required secondary.
  * <p>
  * When detached, deregister itself as Monitor.Listener and detaches all secondary
- * from the primary StatValues.
+ * from the primary Metrics.
  *
  * @author <a href="mailto:nicolas@apache.org">Nicolas De Loof</a>
  */
@@ -51,9 +51,9 @@
         this.monitor = monitor;
         this.attachedAt = System.currentTimeMillis();
         this.detached = false;
-        for ( StatValue value : monitor.getValues() )
+        for ( Metric metric : monitor.getMetrics() )
         {
-            onStatValueRegistered(  value );
+            onMetricRegistered( metric );
         }
         monitor.addListener( this );
     }
@@ -62,22 +62,22 @@
     public void detach()
     {
         this.detached = true;
-        for ( StatValue value : monitor.getValues() )
+        for ( Metric metric : monitor.getMetrics() )
         {
-            if ( value instanceof Composite )
+            if ( metric instanceof Composite )
             {
-                ( (Composite<StatValue>) value ).removeSecondary( getValue( value.getRole() ) );
+                ( (Composite<Metric>) metric ).removeSecondary( getMetric( metric.getRole() ) );
             }
         }
         this.detachedAt = System.currentTimeMillis();
     }
 
     @SuppressWarnings("unchecked")
-    public void onStatValueRegistered( StatValue value )
+    public void onMetricRegistered( Metric metric )
     {
-        if ( !detached && value instanceof Composite )
+        if ( !detached && metric instanceof Composite )
         {
-            register( ( (Composite<StatValue>) value ).createSecondary() );
+            register( ( (Composite<Metric>) metric ).createSecondary() );
         }
     }
 

Modified: commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/listeners/ThresholdListener.java
URL: http://svn.apache.org/viewvc/commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/listeners/ThresholdListener.java?rev=679034&r1=679033&r2=679034&view=diff
==============================================================================
--- commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/listeners/ThresholdListener.java (original)
+++ commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/listeners/ThresholdListener.java Wed Jul 23 02:00:21 2008
@@ -17,8 +17,8 @@
 
 package org.apache.commons.monitoring.listeners;
 
-import org.apache.commons.monitoring.StatValue;
-import org.apache.commons.monitoring.StatValue.Listener;
+import org.apache.commons.monitoring.Metric;
+import org.apache.commons.monitoring.Metric.Listener;
 
 /**
  * @author <a href="mailto:nicolas@apache.org">Nicolas De Loof</a>
@@ -28,13 +28,13 @@
 {
     public abstract long getThreshold();
 
-    public final void onValueChanged( StatValue value, long l )
+    public final void onValueChanged( Metric metric, long l )
     {
         if ( l > getThreshold() )
         {
-            exceed( value, l );
+            exceed( metric, l );
         }
     }
 
-    public abstract void  exceed( StatValue value, long l );
+    public abstract void exceed( Metric metric, long l );
 }

Modified: commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/reporting/AbstractRenderer.java
URL: http://svn.apache.org/viewvc/commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/reporting/AbstractRenderer.java?rev=679034&r1=679033&r2=679034&view=diff
==============================================================================
--- commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/reporting/AbstractRenderer.java (original)
+++ commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/reporting/AbstractRenderer.java Wed Jul 23 02:00:21 2008
@@ -28,9 +28,9 @@
 import java.util.Set;
 
 import org.apache.commons.monitoring.Counter;
+import org.apache.commons.monitoring.Metric;
 import org.apache.commons.monitoring.Monitor;
 import org.apache.commons.monitoring.Role;
-import org.apache.commons.monitoring.StatValue;
 import org.apache.commons.monitoring.Unit;
 import org.apache.commons.monitoring.Monitor.Key;
 import org.apache.commons.monitoring.listeners.Detachable;
@@ -97,7 +97,7 @@
             renderDetached( ctx, (Detachable) monitor, options );
         }
         render( ctx, monitor.getKey() );
-        renderStatValues( ctx, monitor, options );
+        renderMetrics( ctx, monitor, options );
     }
 
     protected boolean isDetatched( Monitor monitor )
@@ -108,142 +108,141 @@
     protected abstract void renderDetached( Context ctx, Detachable detached, Options options );
 
     @SuppressWarnings( "unchecked" )
-    protected void renderStatValues( Context ctx, Monitor monitor, Options options )
+    protected void renderMetrics( Context ctx, Monitor monitor, Options options )
     {
         List<Role> roles = (List<Role>) ctx.get( ROLES );
-        renderStatValues( ctx, monitor, options, roles );
+        renderMetrics( ctx, monitor, options, roles );
     }
 
     @SuppressWarnings("unchecked")
-    protected void renderStatValues( Context ctx, Monitor monitor, Options options, List<Role> roles )
+    protected void renderMetrics( Context ctx, Monitor monitor, Options options, List<Role> roles )
     {
         for ( Iterator<Role> iterator = roles.iterator(); iterator.hasNext(); )
         {
             Role role = iterator.next();
-            StatValue value = monitor.getValue( role );
-            if ( value != null )
+            Metric metric = monitor.getMetric( role );
+            if ( metric != null )
             {
-                render( ctx, value, options );
+                render( ctx, metric, options );
             }
             else
             {
-                renderMissingValue( ctx, role );
+                renderMissingMetric( ctx, role );
             }
             if ( iterator.hasNext() )
             {
-                hasNext( ctx, StatValue.class );
+                hasNext( ctx, Metric.class );
             }
         }
     }
 
     /**
-     * Render an expected value not supported by the current monitor
-     *
+     * Render an expected metric not supported by the current monitor
+     * 
      * @param ctx
      * @param role
      */
     @SuppressWarnings("unchecked")
-    protected void renderMissingValue( Context ctx, Role role )
+    protected void renderMissingMetric( Context ctx, Role role )
     {
         // Nop
     }
 
-    protected List<StatValue> getOrderedStatValues( Monitor monitor, Options options )
+    protected List<Metric> getOrderedMetrics( Monitor monitor, Options options )
     {
-        List<StatValue> values = new LinkedList<StatValue>( monitor.getValues() );
-        for ( Iterator<StatValue> iterator = values.iterator(); iterator.hasNext(); )
+        List<Metric> metrics = new LinkedList<Metric>( monitor.getMetrics() );
+        for ( Iterator<Metric> iterator = metrics.iterator(); iterator.hasNext(); )
         {
-            StatValue value = (StatValue) iterator.next();
+            Metric value = (Metric) iterator.next();
             if ( !options.renderRole( value.getRole() ) )
             {
                 iterator.remove();
             }
         }
-        Collections.sort( values, new Comparator<StatValue>()
+        Collections.sort( metrics, new Comparator<Metric>()
         {
-            public int compare( StatValue value1, StatValue value2 )
+            public int compare( Metric m1, Metric m2 )
             {
-                return value1.getRole().compareTo( value2.getRole() );
+                return m1.getRole().compareTo( m2.getRole() );
             }
         } );
-        return values;
+        return metrics;
     }
 
     @SuppressWarnings("unchecked")
-    protected void render( Context ctx, StatValue value, Options options )
+    protected void render( Context ctx, Metric metric, Options options )
     {
-        Role role = value.getRole();
-        if ( value instanceof Counter )
+        Role role = metric.getRole();
+        if ( metric instanceof Counter )
         {
-            Counter counter = (Counter) value;
+            Counter counter = (Counter) metric;
             if ( options.render( role, "hits" ) )
             {
-                render( ctx, value, "hits", counter.getHits(), options, 0 );
+                render( ctx, metric, "hits", counter.getHits(), options, 0 );
             }
             if ( options.render( role, "sum" ) )
             {
-                render( ctx, value, "sum", counter.getSum(), options );
+                render( ctx, metric, "sum", counter.getSum(), options );
             }
             if ( options.render( role, "squares" ) )
             {
-                render( ctx, value, "squares", counter.getSumOfSquares(), options );
+                render( ctx, metric, "squares", counter.getSumOfSquares(), options );
             }
         }
         if ( options.render( role, "min" ) )
         {
-            render( ctx, value, "min", value.getMin(), options );
+            render( ctx, metric, "min", metric.getMin(), options );
         }
         if ( options.render( role, "max" ) )
         {
-            render( ctx, value, "max", value.getMax(), options );
+            render( ctx, metric, "max", metric.getMax(), options );
         }
         if ( options.render( role, "mean" ) )
         {
-            render( ctx, value, "mean", value.getMean(), options );
+            render( ctx, metric, "mean", metric.getMean(), options );
         }
         if ( options.render( role, "deviation" ) )
         {
-            render( ctx, value, "deviation", value.getStandardDeviation(), options, 1 );
+            render( ctx, metric, "deviation", metric.getStandardDeviation(), options, 1 );
         }
         if ( options.render( role, "value" ) )
         {
-            render( ctx, value, "value", value.get(), options, 1 );
+            render( ctx, metric, "value", metric.get(), options, 1 );
         }
     }
 
     protected abstract void render( Context ctx, Key key );
 
-    protected void render( Context ctx, StatValue value, String attribute, Number number, Options options )
+    protected void render( Context ctx, Metric metric, String attribute, Number number, Options options )
     {
-        render( ctx, value, attribute, number, options, 1 );
+        render( ctx, metric, attribute, number, options, 1 );
     }
 
     /**
-     * Render a StatValue attribute
-     *
+     * Render a Metric attribute
+     * 
      * @param ctx output
-     * @param value the StatValue that hold data to be rendered
-     * @param attribute the StatValue attribute name to be rendered
-     * @param number the the StatValue attribute value to be rendered
-     * @param ratio the ratio between attribute unit and statValue unit (in
-     * power of 10)
+     * @param metric the Metric that hold data to be rendered
+     * @param attribute the Metric attribute name to be rendered
+     * @param number the the Metric attribute value to be rendered
+     * @param ratio the ratio between attribute unit and statValue unit (in power of 10)
      * @param options the rendering options
      */
-    protected void render( Context ctx, StatValue value, String attribute, Number number, Options options, int ratio )
+    protected void render( Context ctx, Metric metric, String attribute, Number number, Options options, int ratio )
     {
         if ( number instanceof Double )
         {
-            renderInternal( ctx, value, attribute, number.doubleValue(), options, ratio );
+            renderInternal( ctx, metric, attribute, number.doubleValue(), options, ratio );
         }
         else
         {
-            renderInternal( ctx, value, attribute, number.longValue(), options, ratio );
+            renderInternal( ctx, metric, attribute, number.longValue(), options, ratio );
         }
     }
 
-    private void renderInternal( Context ctx, StatValue value, String attribute, long l, Options options, int ratio )
+    private void renderInternal( Context ctx, Metric metric, String attribute, long l, Options options, int ratio )
     {
-        Unit unit = options.unitFor( value.getRole() );
+        Unit unit = options.unitFor( metric.getRole() );
         if ( unit != null )
         {
             while ( ratio-- > 0 )
@@ -255,14 +254,14 @@
         ctx.print( options.getNumberFormat().format( l ) );
     }
 
-    private void renderInternal( Context ctx, StatValue value, String attribute, double d, Options options, int ratio )
+    private void renderInternal( Context ctx, Metric metric, String attribute, double d, Options options, int ratio )
     {
         if ( Double.isNaN( d ) )
         {
             renderNaN( ctx );
             return;
         }
-        Unit unit = options.unitFor( value.getRole() );
+        Unit unit = options.unitFor( metric.getRole() );
         if ( unit != null )
         {
             while ( ratio-- > 0 )

Modified: commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/reporting/FlotRenderer.java
URL: http://svn.apache.org/viewvc/commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/reporting/FlotRenderer.java?rev=679034&r1=679033&r2=679034&view=diff
==============================================================================
--- commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/reporting/FlotRenderer.java (original)
+++ commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/reporting/FlotRenderer.java Wed Jul 23 02:00:21 2008
@@ -22,9 +22,9 @@
 import java.util.Iterator;
 import java.util.List;
 
+import org.apache.commons.monitoring.Metric;
 import org.apache.commons.monitoring.Monitor;
 import org.apache.commons.monitoring.Role;
-import org.apache.commons.monitoring.StatValue;
 import org.apache.commons.monitoring.Monitor.Key;
 import org.apache.commons.monitoring.listeners.Detachable;
 
@@ -100,8 +100,8 @@
                 {
                     Monitor monitor = iterator.next();
                     x++;
-                    StatValue value = monitor.getValue( role );
-                    if ( value == null )
+                    Metric metric = monitor.getMetric( role );
+                    if ( metric == null )
                     {
                         continue;
                     }
@@ -111,7 +111,7 @@
                         ctx.print( "," );
                     }
                     ctx.put( "rendered", false );
-                    render( ctx, value, new OptionsSupport()
+                    render( ctx, metric, new OptionsSupport()
                     {
                         @Override
                         public boolean render( Role role, String string )
@@ -146,10 +146,10 @@
         ctx.print( "] );" );
     }
 
-    protected void render( Context ctx, StatValue value, String attribute, Number number, Options options, int ratio )
+    protected void render( Context ctx, Metric metric, String attribute, Number number, Options options, int ratio )
     {
         ctx.print( "[" + ctx.get( "x" ) + "," );
-        super.render( ctx, value, attribute, number, options, ratio );
+        super.render( ctx, metric, attribute, number, options, ratio );
         ctx.print( "]" );
     }
 

Modified: commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/reporting/HtmlRenderer.java
URL: http://svn.apache.org/viewvc/commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/reporting/HtmlRenderer.java?rev=679034&r1=679033&r2=679034&view=diff
==============================================================================
--- commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/reporting/HtmlRenderer.java (original)
+++ commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/reporting/HtmlRenderer.java Wed Jul 23 02:00:21 2008
@@ -23,9 +23,9 @@
 import java.util.Map;
 
 import org.apache.commons.monitoring.Counter;
+import org.apache.commons.monitoring.Metric;
 import org.apache.commons.monitoring.Monitor;
 import org.apache.commons.monitoring.Role;
-import org.apache.commons.monitoring.StatValue;
 import org.apache.commons.monitoring.Unit;
 import org.apache.commons.monitoring.Monitor.Key;
 import org.apache.commons.monitoring.listeners.Detachable;
@@ -199,10 +199,10 @@
     }
 
     @Override
-    protected void render( Context ctx, StatValue value, String attribute, Number number, Options options, int ratio )
+    protected void render( Context ctx, Metric metric, String attribute, Number number, Options options, int ratio )
     {
         ctx.print( "<td>" );
-        super.render( ctx, value, attribute, number, options, ratio );
+        super.render( ctx, metric, attribute, number, options, ratio );
         ctx.print( "</td>" );
     }
 
@@ -227,12 +227,12 @@
     /**
      * {@inheritDoc}
      *
-     * @see org.apache.commons.monitoring.reporting.AbstractRenderer#renderMissingValue(org.apache.commons.monitoring.reporting.Context,
+     * @see org.apache.commons.monitoring.reporting.AbstractRenderer#renderMissingMetric(org.apache.commons.monitoring.reporting.Context,
      * java.lang.String)
      */
     @SuppressWarnings( "unchecked" )
     @Override
-    protected void renderMissingValue( Context ctx, Role role )
+    protected void renderMissingMetric( Context ctx, Role role )
     {
         Map<String, Integer> columns = (Map<String, Integer>) ctx.get( COLUMNS );
         ctx.print( "<td colspan='" );

Modified: commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/reporting/JsonRenderer.java
URL: http://svn.apache.org/viewvc/commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/reporting/JsonRenderer.java?rev=679034&r1=679033&r2=679034&view=diff
==============================================================================
--- commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/reporting/JsonRenderer.java (original)
+++ commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/reporting/JsonRenderer.java Wed Jul 23 02:00:21 2008
@@ -21,9 +21,9 @@
 import java.util.Date;
 import java.util.List;
 
+import org.apache.commons.monitoring.Metric;
 import org.apache.commons.monitoring.Monitor;
 import org.apache.commons.monitoring.Role;
-import org.apache.commons.monitoring.StatValue;
 import org.apache.commons.monitoring.Monitor.Key;
 import org.apache.commons.monitoring.listeners.Detachable;
 
@@ -105,36 +105,36 @@
     /**
      * {@inheritDoc}
      *
-     * @see org.apache.commons.monitoring.reporting.AbstractRenderer#renderStatValues(org.apache.commons.monitoring.reporting.Context,
+     * @see org.apache.commons.monitoring.reporting.AbstractRenderer#renderMetrics(org.apache.commons.monitoring.reporting.Context,
      * org.apache.commons.monitoring.Monitor,
      * org.apache.commons.monitoring.reporting.Renderer.Options)
      */
     @Override
-    protected void renderStatValues( Context ctx, Monitor monitor, Options options, List<Role> roles  )
+    protected void renderMetrics( Context ctx, Monitor monitor, Options options, List<Role> roles  )
     {
         if ( roles.size() > 0 )
         {
             ctx.print( "," );
         }
-        super.renderStatValues( ctx, monitor, options, roles );
+        super.renderMetrics( ctx, monitor, options, roles );
     }
 
     @Override
-    public void render( Context ctx, StatValue value, Options options )
+    public void render( Context ctx, Metric metric, Options options )
     {
-        ctx.print( value.getRole().getName() );
+        ctx.print( metric.getRole().getName() );
         ctx.print( ":{" );
-        super.render( ctx, value, options );
+        super.render( ctx, metric, options );
         ctx.print( "}" );
     }
 
     @Override
-    protected void render( Context ctx, StatValue value, String attribute, Number number, Options options, int ratio )
+    protected void render( Context ctx, Metric metric, String attribute, Number number, Options options, int ratio )
     {
-        StatValue currentValue = (StatValue) ctx.get( "currentValue" );
-        if ( currentValue != value )
+        Metric currentValue = (Metric) ctx.get( "currentValue" );
+        if ( currentValue != metric )
         {
-            ctx.put( "currentValue", value );
+            ctx.put( "currentValue", metric );
             ctx.put( "firstAttribute", Boolean.TRUE );
         }
         Boolean firstAttribute = (Boolean) ctx.get( "firstAttribute" );
@@ -144,7 +144,7 @@
         }
         ctx.print( attribute );
         ctx.print( ":\"" );
-        super.render( ctx, value, attribute, number, options, ratio );
+        super.render( ctx, metric, attribute, number, options, ratio );
         ctx.print( "\"" );
         ctx.put( "firstAttribute", Boolean.FALSE );
     }

Modified: commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/reporting/Selector.java
URL: http://svn.apache.org/viewvc/commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/reporting/Selector.java?rev=679034&r1=679033&r2=679034&view=diff
==============================================================================
--- commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/reporting/Selector.java (original)
+++ commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/reporting/Selector.java Wed Jul 23 02:00:21 2008
@@ -28,10 +28,9 @@
 import org.apache.commons.monitoring.Monitor.Key;
 
 /**
- * use a REST-style path to select a group of statValues. For example, to get
- * the mean performance for monitors in category "services"
- * <tt>/monitorsFromCategory/services/counter/performances/mean</tt>
- *
+ * use a REST-style path to select a group of Metrics. For example, to get the mean performance for monitors in category
+ * "services" <tt>/monitorsFromCategory/services/counter/performances/mean</tt>
+ * 
  * @author <a href="mailto:nicolas@apache.org">Nicolas De Loof</a>
  */
 public class Selector

Modified: commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/reporting/SelectorPeriodicLogger.java
URL: http://svn.apache.org/viewvc/commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/reporting/SelectorPeriodicLogger.java?rev=679034&r1=679033&r2=679034&view=diff
==============================================================================
--- commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/reporting/SelectorPeriodicLogger.java (original)
+++ commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/reporting/SelectorPeriodicLogger.java Wed Jul 23 02:00:21 2008
@@ -78,21 +78,21 @@
     protected final void log( SecondaryRepository period )
         throws IOException
     {
-        Object[] values = new Object[selectors.length];
+        Object[] metrics = new Object[selectors.length];
         for ( int i = 0; i < selectors.length; i++ )
         {
-            values[i] = selectors[i].select( period );
+            metrics[i] = selectors[i].select( period );
         }
-        log( values );
+        log( metrics );
     }
 
     /**
      * Log the data extracted by selectors
      *
-     * @param values the data to log
+     * @param metrics the data to log
      * @throws IOException any I/O error during log
      */
-    protected abstract void log( Object[] values )
+    protected abstract void log( Object[] metrics )
         throws IOException;
 
 }

Modified: commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/reporting/TxtRenderer.java
URL: http://svn.apache.org/viewvc/commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/reporting/TxtRenderer.java?rev=679034&r1=679033&r2=679034&view=diff
==============================================================================
--- commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/reporting/TxtRenderer.java (original)
+++ commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/reporting/TxtRenderer.java Wed Jul 23 02:00:21 2008
@@ -19,7 +19,7 @@
 
 import java.util.Date;
 
-import org.apache.commons.monitoring.StatValue;
+import org.apache.commons.monitoring.Metric;
 import org.apache.commons.monitoring.Monitor.Key;
 import org.apache.commons.monitoring.listeners.Detachable;
 
@@ -56,20 +56,20 @@
      * @see org.apache.commons.monitoring.reporting.AbstractRenderer#render(Context, java.lang.String)
      */
     @Override
-    public void render( Context ctx, StatValue value, Options options )
+    public void render( Context ctx, Metric metric, Options options )
     {
-        ctx.println( value.getRole().getName() );
-        super.render( ctx, value, options );
+        ctx.println( metric.getRole().getName() );
+        super.render( ctx, metric, options );
         ctx.println( "" );
     }
 
     @Override
-    protected void render( Context ctx, StatValue value, String attribute, Number number, Options options, int ratio )
+    protected void render( Context ctx, Metric metric, String attribute, Number number, Options options, int ratio )
     {
         ctx.print( "    " );
         ctx.print( attribute );
         ctx.print( " : " );
-        super.render( ctx, value, attribute, number, options, ratio );
+        super.render( ctx, metric, attribute, number, options, ratio );
         ctx.println( "" );
     }
 

Modified: commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/reporting/XmlRenderer.java
URL: http://svn.apache.org/viewvc/commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/reporting/XmlRenderer.java?rev=679034&r1=679033&r2=679034&view=diff
==============================================================================
--- commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/reporting/XmlRenderer.java (original)
+++ commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/reporting/XmlRenderer.java Wed Jul 23 02:00:21 2008
@@ -21,8 +21,8 @@
 import java.util.Date;
 import java.util.List;
 
+import org.apache.commons.monitoring.Metric;
 import org.apache.commons.monitoring.Monitor;
-import org.apache.commons.monitoring.StatValue;
 import org.apache.commons.monitoring.Monitor.Key;
 import org.apache.commons.monitoring.listeners.Detachable;
 
@@ -96,21 +96,21 @@
 
 
     @Override
-    public void render( Context ctx, StatValue value, Options options )
+    public void render( Context ctx, Metric metric, Options options )
     {
         ctx.print( "<" );
-        ctx.print( value.getRole().getName() );
-        super.render( ctx, value, options );
+        ctx.print( metric.getRole().getName() );
+        super.render( ctx, metric, options );
         ctx.print( "/>" );
     }
 
     @Override
-    protected void render( Context ctx, StatValue value, String attribute, Number number, Options options, int ratio )
+    protected void render( Context ctx, Metric metric, String attribute, Number number, Options options, int ratio )
     {
         ctx.print( " " );
         ctx.print( attribute );
         ctx.print( "=\"" );
-        super.render( ctx, value, attribute, number, options, ratio );
+        super.render( ctx, metric, attribute, number, options, ratio );
         ctx.print( "\"" );
     }
 

Modified: commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/reporting/web/NiceHtmlRenderer.java
URL: http://svn.apache.org/viewvc/commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/reporting/web/NiceHtmlRenderer.java?rev=679034&r1=679033&r2=679034&view=diff
==============================================================================
--- commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/reporting/web/NiceHtmlRenderer.java (original)
+++ commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/reporting/web/NiceHtmlRenderer.java Wed Jul 23 02:00:21 2008
@@ -95,7 +95,7 @@
 
     @SuppressWarnings("unchecked")
     @Override
-    protected void renderMissingValue( Context ctx, Role role )
+    protected void renderMissingMetric( Context ctx, Role role )
     {
         Map<String, Integer> columns = (Map<String, Integer>) ctx.get( COLUMNS );
         ctx.print( "<td class='not-applicable' colspan='" );

Copied: commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/servlet/jsp/MetricTag.java (from r663070, commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/servlet/jsp/StatValueTag.java)
URL: http://svn.apache.org/viewvc/commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/servlet/jsp/MetricTag.java?p2=commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/servlet/jsp/MetricTag.java&p1=commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/servlet/jsp/StatValueTag.java&r1=663070&r2=679034&rev=679034&view=diff
==============================================================================
--- commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/servlet/jsp/StatValueTag.java (original)
+++ commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/servlet/jsp/MetricTag.java Wed Jul 23 02:00:21 2008
@@ -7,7 +7,7 @@
 import org.apache.commons.monitoring.Counter;
 import org.apache.commons.monitoring.Role;
 
-public class StatValueTag
+public class MetricTag
     extends TagSupport
 {
     private String roleAttrName;

Propchange: commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/servlet/jsp/MetricTag.java
------------------------------------------------------------------------------
    svn:mergeinfo = 

Propchange: commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/servlet/jsp/MetricTag.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/support/jaxws/PerformancesHandler.java
URL: http://svn.apache.org/viewvc/commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/support/jaxws/PerformancesHandler.java?rev=679034&view=auto
==============================================================================
--- commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/support/jaxws/PerformancesHandler.java (added)
+++ commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/support/jaxws/PerformancesHandler.java Wed Jul 23 02:00:21 2008
@@ -0,0 +1,148 @@
+///*
+// * 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.commons.monitoring.support.jaxws;
+//
+//import static javax.xml.ws.handler.MessageContext.WSDL_OPERATION;
+//import static javax.xml.ws.handler.MessageContext.WSDL_SERVICE;
+//
+//import java.util.Set;
+//
+//import javax.xml.namespace.QName;
+//import javax.xml.ws.handler.MessageContext;
+//import javax.xml.ws.handler.soap.SOAPHandler;
+//import javax.xml.ws.handler.soap.SOAPMessageContext;
+//
+//import org.apache.commons.monitoring.Monitor;
+//import org.apache.commons.monitoring.Monitoring;
+//import org.apache.commons.monitoring.Repository;
+//import org.apache.commons.monitoring.StopWatch;
+//import org.apache.commons.monitoring.Unit;
+//
+///**
+// * JAX-WS handler to monitor web services performances.
+// * <p>
+// * WARNING : experimental code
+// *
+// * @author <a href="mailto:nicolas@apache.org">Nicolas De Loof</a>
+// */
+//public class PerformancesHandler
+//    implements SOAPHandler<SOAPMessageContext>
+//{
+//    private static final String STOPWATCH = "org.apache.commons.monitoring.support.jaxws.STOPWATCH";
+//
+//    private static final String MONITOR = "org.apache.commons.monitoring.support.jaxws.MONITOR";
+//
+//    private Repository repository = Monitoring.getRepository();
+//
+//    private String category = "jax-ws";
+//
+//    private String subsystem;
+//
+//    /**
+//     * {@inheritDoc}
+//     *
+//     * @see javax.xml.ws.handler.soap.SOAPHandler#getHeaders()
+//     */
+//    public Set<QName> getHeaders()
+//    {
+//        return null;
+//    }
+//
+//    /**
+//     * {@inheritDoc}
+//     *
+//     * @see javax.xml.ws.handler.Handler#handleMessage(javax.xml.ws.handler.MessageContext)
+//     */
+//    public boolean handleMessage( SOAPMessageContext context )
+//    {
+//        Monitor monitor = repository.getMonitor( getMonitorName( context ), category, subsystem );
+//        context.put( MONITOR, repository.start( monitor ) );
+//        context.put( STOPWATCH, repository.start( monitor ) );
+//        return true;
+//    }
+//
+//    /**
+//     * {@inheritDoc}
+//     *
+//     * @see javax.xml.ws.handler.Handler#close(javax.xml.ws.handler.MessageContext)
+//     */
+//    public void close( MessageContext context )
+//    {
+//        StopWatch stopWatch = (StopWatch) context.get( STOPWATCH );
+//        if ( stopWatch != null )
+//        {
+//            stopWatch.stop();
+//        }
+//    }
+//
+//    /**
+//     * {@inheritDoc}
+//     *
+//     * @see javax.xml.ws.handler.Handler#handleFault(javax.xml.ws.handler.MessageContext)
+//     */
+//    public boolean handleFault( SOAPMessageContext context )
+//    {
+//        Monitor monitor = (Monitor) context.get( MONITOR );
+//        StopWatch stopWatch = (StopWatch) context.get( STOPWATCH );
+//        if ( stopWatch != null && monitor != null )
+//        {
+//            monitor.getCounter( Monitor.FAILURES ).add( stopWatch.getElapsedTime(), Unit.NANOS );
+//        }
+//        return true;
+//    }
+//
+//    /**
+//     * Build the monitor name for the incoming message
+//     *
+//     * @param context the JAX-WS MessageContext
+//     * @return the monitor name to use
+//     */
+//    protected String getMonitorName( SOAPMessageContext context )
+//    {
+//        StringBuilder name = new StringBuilder();
+//        name.append( context.get( WSDL_SERVICE ) );
+//        name.append( "." );
+//        name.append( context.get( WSDL_OPERATION ) );
+//        return name.toString();
+//    }
+//
+//    /**
+//     * @param repository the repository to set
+//     */
+//    public void setRepository( Repository repository )
+//    {
+//        this.repository = repository;
+//    }
+//
+//    /**
+//     * @param category the category to set
+//     */
+//    public void setCategory( String category )
+//    {
+//        this.category = category;
+//    }
+//
+//    /**
+//     * @param subsystem the subsystem to set
+//     */
+//    public void setSubsystem( String subsystem )
+//    {
+//        this.subsystem = subsystem;
+//    }
+//
+//}

Propchange: commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/support/jaxws/PerformancesHandler.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/support/jaxws/PerformancesHandler.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/support/jaxws/PerformancesHandler.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: commons/sandbox/monitoring/trunk/src/main/resources/META-INF/monitoring.tld
URL: http://svn.apache.org/viewvc/commons/sandbox/monitoring/trunk/src/main/resources/META-INF/monitoring.tld?rev=679034&r1=679033&r2=679034&view=diff
==============================================================================
--- commons/sandbox/monitoring/trunk/src/main/resources/META-INF/monitoring.tld (original)
+++ commons/sandbox/monitoring/trunk/src/main/resources/META-INF/monitoring.tld Wed Jul 23 02:00:21 2008
@@ -135,7 +135,7 @@
 
     <tag>
         <name>statvalue</name>
-        <tagclass>org.apache.commons.monitoring.servlet.jsp.StatValueTag</tagclass>
+        <tagclass>org.apache.commons.monitoring.servlet.jsp.MetricTag</tagclass>
         <bodycontent>empty</bodycontent>
         <attribute>
             <name>role</name>

Added: commons/sandbox/monitoring/trunk/src/main/webapp/test.jsp
URL: http://svn.apache.org/viewvc/commons/sandbox/monitoring/trunk/src/main/webapp/test.jsp?rev=679034&view=auto
==============================================================================
--- commons/sandbox/monitoring/trunk/src/main/webapp/test.jsp (added)
+++ commons/sandbox/monitoring/trunk/src/main/webapp/test.jsp Wed Jul 23 02:00:21 2008
@@ -0,0 +1,44 @@
+<%@ page contentType="text/html; charset=ISO-8859-1" %>
+<%@ taglib prefix="monitoring" uri="http://commons.apache.org/monitoring/tags"%>
+<html>
+<head>
+    <style type="text/css">
+    li { list-style: none; }
+    body { font-family: arial, sans-serif; font-size: 0.9em }
+    </style>
+</head>
+<body>
+<form>
+<radiogroup>
+  <ul>
+    <li><input type=radio value="/monitors" checked="checked">all monitors</li>
+    <li><input type=radio value="/monitorsInCategory">all monitors from category <select><option>default</option></select></li>
+    <li><input type=radio value="/monitorsInSubsystem">all monitors from subsystem <select><option>default</option></select></li>
+  </ul>
+<radiogroup>
+<ul>
+    <li><input type="checkbox" checked="checked">performances <monitoring:unit name="unit" unit="ms"/>
+        <ul>
+            <li><input type="checkbox">current value</li>
+            <li><input type="checkbox">total</li>
+            <li><input type="checkbox">hits</li>
+            <li><input type="checkbox">min</li>
+            <li><input type="checkbox">max</li>
+            <li><input type="checkbox">mean</li>
+            <li><input type="checkbox">standard deviation</li>
+        </ul>
+    </li>
+    <li><input type="checkbox" checked="checked">concurrency <monitoring:unit name="unit" unit=""/>
+        <ul>
+            <li><input type="checkbox">current value</li>
+            <li><input type="checkbox">min</li>
+            <li><input type="checkbox">max</li>
+            <li><input type="checkbox">mean</li>
+            <li><input type="checkbox">standard deviation</li>
+        </ul>
+
+    </li>
+</ul>
+</form>
+</body>
+</html>

Propchange: commons/sandbox/monitoring/trunk/src/main/webapp/test.jsp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: commons/sandbox/monitoring/trunk/src/main/webapp/test.jsp
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: commons/sandbox/monitoring/trunk/src/main/webapp/test.jsp
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: commons/sandbox/monitoring/trunk/src/site/xdoc/instrumentation.xml
URL: http://svn.apache.org/viewvc/commons/sandbox/monitoring/trunk/src/site/xdoc/instrumentation.xml?rev=679034&r1=679033&r2=679034&view=diff
==============================================================================
--- commons/sandbox/monitoring/trunk/src/site/xdoc/instrumentation.xml (original)
+++ commons/sandbox/monitoring/trunk/src/site/xdoc/instrumentation.xml Wed Jul 23 02:00:21 2008
@@ -71,7 +71,7 @@
       </subsection>
       <subsection name="Counters and Gauges">
       <p>
-        Monitors manage a set of <code>StatValues</code> that the application uses to expose state. The
+        Monitors manage a set of <code>Metrics</code> that the application uses to expose state. The
         monitor only identifies where the data comes from, and the statValues handle the monitored data.
         There is two types of values that application can use, depending on the data to be exposed :
         <ul>
@@ -97,7 +97,7 @@
       <p>
         In both cases, the statValues compute statistical information from what the application exposes, like
         min / max / mean and standard deviation, that in many case is more informative than the current value.
-        Available statistical indicators are limited as a StatValue does not maintain all the individual
+        Available statistical indicators are limited as a Metric does not maintain all the individual
         elements as a serie but only aggregates, to avoid memory over-consumption.
       </p>
       <p>The <a href="xref/org/apache/commons/monitoring/impl/monitors/CreateValuesOnDemandMonitor">
@@ -107,7 +107,7 @@
       </subsection>
       <subsection name="Role">
       <p>
-        A monitor can handle many statValues. StatValues are identified in a monitor by a role, that
+        A monitor can handle many statValues. Metrics are identified in a monitor by a role, that
         describes the data beeing computed. There is predefined roles for performances, concurrency
         monitoring and failures count, but any other relevant counter/gauge can be registered to a monitor.
         <pre>

Modified: commons/sandbox/monitoring/trunk/src/site/xdoc/listeners.xml
URL: http://svn.apache.org/viewvc/commons/sandbox/monitoring/trunk/src/site/xdoc/listeners.xml?rev=679034&r1=679033&r2=679034&view=diff
==============================================================================
--- commons/sandbox/monitoring/trunk/src/site/xdoc/listeners.xml (original)
+++ commons/sandbox/monitoring/trunk/src/site/xdoc/listeners.xml Wed Jul 23 02:00:21 2008
@@ -36,13 +36,13 @@
         implementation to use. A more elegant way is to attach a Listener to the Gauge that monitors the load.
       </p>
       <p>
-        Repository, Monitors and StatValues support listeners. The <code>StatValue.Listener</code> interface
+        Repository, Monitors and Metrics support listeners. The <code>Metric.Listener</code> interface
         allows custom code to get notified when a value is updated. This is a nice way to detect some
         value to increase abnormally and to adapt application behavior. The main advantage is that such
         listener can be reused and don't require code intrusive changes in the monitored components.
       </p>
       <p>
-        <code>Monitor.Listener</code> allows the application to get evolved when a new StatValue is registered
+        <code>Monitor.Listener</code> allows the application to get evolved when a new Metric is registered
         to the monitor. The application can register new statValues (or <em>automagically</em> creates new ones
         when requested) at any moment, and this listener can be used to get notified and pre-configure the
         statValue before it gets used.

Modified: commons/sandbox/monitoring/trunk/src/site/xdoc/tutorial.xml
URL: http://svn.apache.org/viewvc/commons/sandbox/monitoring/trunk/src/site/xdoc/tutorial.xml?rev=679034&r1=679033&r2=679034&view=diff
==============================================================================
--- commons/sandbox/monitoring/trunk/src/site/xdoc/tutorial.xml (original)
+++ commons/sandbox/monitoring/trunk/src/site/xdoc/tutorial.xml Wed Jul 23 02:00:21 2008
@@ -56,13 +56,13 @@
         convenient and powerfull way to group and sort monitors and associated statistics.
       </p>
       <p>
-        The monitor maintains a set of StatValues, that can be either <b>Counters</b> or <b>Gauges</b>.
+        The monitor maintains a set of Metrics, that can be either <b>Counters</b> or <b>Gauges</b>.
         <ul>
           <li>A Counter will get incremented any time the application does its work and expose the result to
           the monitoring backbone : byte received, lines processed...</li>
           <li>A Gauge allows the application to expose how a resource is used : active connections...</li>
         </ul>
-        Each StatValue is identified by a ROLE in the monitor. Default roles are defined for PERFORMANCES and
+        Each Metric is identified by a ROLE in the monitor. Default roles are defined for PERFORMANCES and
         CONCURRENCY (threads running same code), and you can register Counters/Gauges for custom roles to monitor
         anything that is relevant for your application (bytes processed, message payload, account balance ...)  :
         <pre>
@@ -80,7 +80,7 @@
     </section>
     <section name="Repporting">
       <p>
-        You can retrieve statistical datas from your monitors and StatValues to build reports. You can
+        You can retrieve statistical datas from your monitors and Metrics to build reports. You can
         programatically acces the repository and iterate on monitors to build a custom output, or rely
         on Commons Monitoring provided <b>Renderers</b> that support common output formats (XML, TXT, JSON).
       </p>



Mime
View raw message