commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nico...@apache.org
Subject svn commit: r663074 - in /commons/sandbox/monitoring/trunk/src: main/java/org/apache/commons/monitoring/ main/java/org/apache/commons/monitoring/reporting/ test/java/org/apache/commons/monitoring/reporting/ test/resources/org/apache/commons/monitoring/...
Date Wed, 04 Jun 2008 12:48:27 GMT
Author: nicolas
Date: Wed Jun  4 05:48:27 2008
New Revision: 663074

URL: http://svn.apache.org/viewvc?rev=663074&view=rev
Log:
render sum of squares to support post-processing of stats and datas from multiple instances
(cluster) aggregation

Modified:
    commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/Counter.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/test/java/org/apache/commons/monitoring/reporting/RendererTest.java
    commons/sandbox/monitoring/trunk/src/test/resources/org/apache/commons/monitoring/reporting/RendererTest.flot
    commons/sandbox/monitoring/trunk/src/test/resources/org/apache/commons/monitoring/reporting/RendererTest.html
    commons/sandbox/monitoring/trunk/src/test/resources/org/apache/commons/monitoring/reporting/RendererTest.js
    commons/sandbox/monitoring/trunk/src/test/resources/org/apache/commons/monitoring/reporting/RendererTest.txt
    commons/sandbox/monitoring/trunk/src/test/resources/org/apache/commons/monitoring/reporting/RendererTest.xml

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=663074&r1=663073&r2=663074&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 Jun  4 05:48:27 2008
@@ -43,5 +43,10 @@
      */
     int getHits();
 
+    /**
+     * @return the sum of squares for individual events, usefull to compute some statistics
+     */
+    long getSumOfSquares();
+
 }
 

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=663074&r1=663073&r2=663074&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 Jun  4 05:48:27 2008
@@ -184,6 +184,10 @@
             {
                 render( ctx, value, "sum", counter.getSum(), options );
             }
+            if ( options.render( role, "squares" ) )
+            {
+                render( ctx, value, "squares", counter.getSumOfSquares(), options );
+            }
         }
         if ( options.render( role, "min" ) )
         {

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=663074&r1=663073&r2=663074&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 Jun  4 05:48:27 2008
@@ -52,7 +52,7 @@
 public class FlotRenderer
     extends AbstractRenderer
 {
-    private static final String[] ATTRIBUTES = { "hits", "sum", "min", "max", "mean", "deviation",
"value" };
+    private static final String[] ATTRIBUTES = { "hits", "sum", "squares", "min", "max",
"mean", "deviation", "value" };
 
     public FlotRenderer()
     {

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=663074&r1=663073&r2=663074&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 Jun  4 05:48:27 2008
@@ -116,6 +116,7 @@
             {
                 span += options.render( role, "hits" ) ? 1 : 0;
                 span += options.render( role, "sum" ) ? 1 : 0;
+                span += options.render( role, "squares" ) ? 1 : 0;
             }
             span += options.render( role, "min" ) ? 1 : 0;
             span += options.render( role, "max" ) ? 1 : 0;
@@ -150,6 +151,7 @@
             {
                 writeColumnHead( ctx, options, role, "hits" );
                 writeColumnHead( ctx, options, role, "sum" );
+                writeColumnHead( ctx, options, role, "squares" );
             }
             writeColumnHead( ctx, options, role, "min" );
             writeColumnHead( ctx, options, role, "max" );

Modified: commons/sandbox/monitoring/trunk/src/test/java/org/apache/commons/monitoring/reporting/RendererTest.java
URL: http://svn.apache.org/viewvc/commons/sandbox/monitoring/trunk/src/test/java/org/apache/commons/monitoring/reporting/RendererTest.java?rev=663074&r1=663073&r2=663074&view=diff
==============================================================================
--- commons/sandbox/monitoring/trunk/src/test/java/org/apache/commons/monitoring/reporting/RendererTest.java
(original)
+++ commons/sandbox/monitoring/trunk/src/test/java/org/apache/commons/monitoring/reporting/RendererTest.java
Wed Jun  4 05:48:27 2008
@@ -19,6 +19,7 @@
 
 import java.io.PrintWriter;
 import java.io.StringWriter;
+import java.lang.management.ManagementFactory;
 import java.util.Collection;
 import java.util.LinkedList;
 
@@ -54,6 +55,8 @@
         m2.getCounter( Monitor.PERFORMANCES );
         m2.getGauge( Monitor.CONCURRENCY ).increment(Unit.UNARY);
         monitors.add( m2 );
+
+        ManagementFactory.getThreadMXBean().setThreadCpuTimeEnabled( false );
     }
 
     public void testRenderToJson()

Modified: commons/sandbox/monitoring/trunk/src/test/resources/org/apache/commons/monitoring/reporting/RendererTest.flot
URL: http://svn.apache.org/viewvc/commons/sandbox/monitoring/trunk/src/test/resources/org/apache/commons/monitoring/reporting/RendererTest.flot?rev=663074&r1=663073&r2=663074&view=diff
==============================================================================
--- commons/sandbox/monitoring/trunk/src/test/resources/org/apache/commons/monitoring/reporting/RendererTest.flot
(original)
+++ commons/sandbox/monitoring/trunk/src/test/resources/org/apache/commons/monitoring/reporting/RendererTest.flot
Wed Jun  4 05:48:27 2008
@@ -4,29 +4,33 @@
  data: []},
 { color: 1, label: "concurrency.sum",
  data: []},
-{ color: 2, label: "concurrency.min",
+{ color: 2, label: "concurrency.squares",
+ data: []},
+{ color: 3, label: "concurrency.min",
  data: [[1,0],[2,1]]},
-{ color: 3, label: "concurrency.max",
+{ color: 4, label: "concurrency.max",
  data: [[1,0],[2,1]]},
-{ color: 4, label: "concurrency.mean",
+{ color: 5, label: "concurrency.mean",
  data: [[1,NaN],[2,0.00]]},
-{ color: 5, label: "concurrency.deviation",
+{ color: 6, label: "concurrency.deviation",
  data: [[1,NaN],[2,NaN]]},
-{ color: 6, label: "concurrency.value",
+{ color: 7, label: "concurrency.value",
  data: [[1,0],[2,1]]},
-{ color: 7, label: "performances.hits",
+{ color: 8, label: "performances.hits",
  data: [[1,1],[2,0]]},
-{ color: 8, label: "performances.sum",
+{ color: 9, label: "performances.sum",
  data: [[1,10],[2,0]]},
-{ color: 9, label: "performances.min",
+{ color: 10, label: "performances.squares",
+ data: [[1,100],[2,0]]},
+{ color: 11, label: "performances.min",
  data: [[1,10],[2,0]]},
-{ color: 10, label: "performances.max",
+{ color: 12, label: "performances.max",
  data: [[1,10],[2,0]]},
-{ color: 11, label: "performances.mean",
+{ color: 13, label: "performances.mean",
  data: [[1,10.00],[2,NaN]]},
-{ color: 12, label: "performances.deviation",
+{ color: 14, label: "performances.deviation",
  data: [[1,NaN],[2,NaN]]},
-{ color: 13, label: "performances.value",
+{ color: 15, label: "performances.value",
  data: [[1,10],[2,0]]}
 
 ] );
\ No newline at end of file

Modified: commons/sandbox/monitoring/trunk/src/test/resources/org/apache/commons/monitoring/reporting/RendererTest.html
URL: http://svn.apache.org/viewvc/commons/sandbox/monitoring/trunk/src/test/resources/org/apache/commons/monitoring/reporting/RendererTest.html?rev=663074&r1=663073&r2=663074&view=diff
==============================================================================
--- commons/sandbox/monitoring/trunk/src/test/resources/org/apache/commons/monitoring/reporting/RendererTest.html
(original)
+++ commons/sandbox/monitoring/trunk/src/test/resources/org/apache/commons/monitoring/reporting/RendererTest.html
Wed Jun  4 05:48:27 2008
@@ -4,10 +4,10 @@
 <thead>
 <tr><th rowspan='2'>name</th><th rowspan='2'>category</th><th
rowspan='2'>subsystem</th>
 <td colspan='5'>concurrency</td>
-<td colspan='7'>performances (ns)</td>
+<td colspan='8'>performances (ns)</td>
 </tr>
 <tr><th>min</th><th>max</th><th>mean</th><th>deviation</th><th>value</th>
-<th>hits</th><th>sum</th><th>min</th><th>max</th><th>mean</th><th>deviation</th><th>value</th>
+<th>hits</th><th>sum</th><th>squares</th><th>min</th><th>max</th><th>mean</th><th>deviation</th><th>value</th>
 </tr>
 </thead>
 
@@ -16,13 +16,13 @@
 <tr>
 <td>JsonRendererTest.setUp</td><td>test</td><td>reporting</td>
 <td>0</td><td>0</td><td>-</td><td>-</td><td>0</td>
-<td>1</td><td>10</td><td>10</td><td>10</td><td>10.00</td><td>-</td><td>10</td>
+<td>1</td><td>10</td><td>100</td><td>10</td><td>10</td><td>10.00</td><td>-</td><td>10</td>
 </tr>
 
 <tr>
 <td>TestCase</td><td>test</td><td>junit</td>
 <td>1</td><td>1</td><td>0.00</td><td>-</td><td>1</td>
-<td>0</td><td>0</td><td>0</td><td>0</td><td>-</td><td>-</td><td>0</td>
+<td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>-</td><td>-</td><td>0</td>
 </tr>
 
 </tbody>

Modified: commons/sandbox/monitoring/trunk/src/test/resources/org/apache/commons/monitoring/reporting/RendererTest.js
URL: http://svn.apache.org/viewvc/commons/sandbox/monitoring/trunk/src/test/resources/org/apache/commons/monitoring/reporting/RendererTest.js?rev=663074&r1=663073&r2=663074&view=diff
==============================================================================
--- commons/sandbox/monitoring/trunk/src/test/resources/org/apache/commons/monitoring/reporting/RendererTest.js
(original)
+++ commons/sandbox/monitoring/trunk/src/test/resources/org/apache/commons/monitoring/reporting/RendererTest.js
Wed Jun  4 05:48:27 2008
@@ -3,13 +3,13 @@
 {
 key:{name:"JsonRendererTest.setUp",category:"test",subsystem:"reporting"},
 concurrency:{min:"0",max:"0",mean:"-",deviation:"-",value:"0"},
-performances:{hits:"1",sum:"10",min:"10",max:"10",mean:"10.00",deviation:"-",value:"10"}
+performances:{hits:"1",sum:"10",squares:"100",min:"10",max:"10",mean:"10.00",deviation:"-",value:"10"}
 },
 
 {
 key:{name:"TestCase",category:"test",subsystem:"junit"},
 concurrency:{min:"1",max:"1",mean:"0.00",deviation:"-",value:"1"},
-performances:{hits:"0",sum:"0",min:"0",max:"0",mean:"-",deviation:"-",value:"0"}
+performances:{hits:"0",sum:"0",squares:"0",min:"0",max:"0",mean:"-",deviation:"-",value:"0"}
 }
 
 ]

Modified: commons/sandbox/monitoring/trunk/src/test/resources/org/apache/commons/monitoring/reporting/RendererTest.txt
URL: http://svn.apache.org/viewvc/commons/sandbox/monitoring/trunk/src/test/resources/org/apache/commons/monitoring/reporting/RendererTest.txt?rev=663074&r1=663073&r2=663074&view=diff
==============================================================================
--- commons/sandbox/monitoring/trunk/src/test/resources/org/apache/commons/monitoring/reporting/RendererTest.txt
(original)
+++ commons/sandbox/monitoring/trunk/src/test/resources/org/apache/commons/monitoring/reporting/RendererTest.txt
Wed Jun  4 05:48:27 2008
@@ -13,6 +13,7 @@
 performances
     hits : 1
     sum : 10
+    squares : 100
     min : 10
     max : 10
     mean : 10.00
@@ -34,6 +35,7 @@
 performances
     hits : 0
     sum : 0
+    squares : 0
     min : 0
     max : 0
     mean : -

Modified: commons/sandbox/monitoring/trunk/src/test/resources/org/apache/commons/monitoring/reporting/RendererTest.xml
URL: http://svn.apache.org/viewvc/commons/sandbox/monitoring/trunk/src/test/resources/org/apache/commons/monitoring/reporting/RendererTest.xml?rev=663074&r1=663073&r2=663074&view=diff
==============================================================================
--- commons/sandbox/monitoring/trunk/src/test/resources/org/apache/commons/monitoring/reporting/RendererTest.xml
(original)
+++ commons/sandbox/monitoring/trunk/src/test/resources/org/apache/commons/monitoring/reporting/RendererTest.xml
Wed Jun  4 05:48:27 2008
@@ -2,12 +2,12 @@
 
 <monitor name="JsonRendererTest.setUp" category="test" subsystem="reporting">
 <concurrency min="0" max="0" mean="-" deviation="-" value="0"/>
-<performances hits="1" sum="10" min="10" max="10" mean="10.00" deviation="-" value="10"/>
+<performances hits="1" sum="10" squares="100" min="10" max="10" mean="10.00" deviation="-"
value="10"/>
 </monitor>
 
 <monitor name="TestCase" category="test" subsystem="junit">
 <concurrency min="1" max="1" mean="0.00" deviation="-" value="1"/>
-<performances hits="0" sum="0" min="0" max="0" mean="-" deviation="-" value="0"/>
+<performances hits="0" sum="0" squares="0" min="0" max="0" mean="-" deviation="-" value="0"/>
 </monitor>
 
 </monitors>
\ No newline at end of file



Mime
View raw message