commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bur...@apache.org
Subject svn commit: r157285 - in jakarta/commons/sandbox/benchmark/trunk: src/java/org/apache/commons/benchmark/Benchmark.java src/java/org/apache/commons/benchmark/rrd/GraphTask.java xdocs/index.xml
Date Sat, 12 Mar 2005 21:51:47 GMT
Author: burton
Date: Sat Mar 12 13:51:45 2005
New Revision: 157285

URL: http://svn.apache.org/viewcvs?view=rev&rev=157285
Log:
refactored to support only closing once...

Modified:
    jakarta/commons/sandbox/benchmark/trunk/src/java/org/apache/commons/benchmark/Benchmark.java
    jakarta/commons/sandbox/benchmark/trunk/src/java/org/apache/commons/benchmark/rrd/GraphTask.java
    jakarta/commons/sandbox/benchmark/trunk/xdocs/index.xml

Modified: jakarta/commons/sandbox/benchmark/trunk/src/java/org/apache/commons/benchmark/Benchmark.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/benchmark/trunk/src/java/org/apache/commons/benchmark/Benchmark.java?view=diff&r1=157284&r2=157285
==============================================================================
--- jakarta/commons/sandbox/benchmark/trunk/src/java/org/apache/commons/benchmark/Benchmark.java
(original)
+++ jakarta/commons/sandbox/benchmark/trunk/src/java/org/apache/commons/benchmark/Benchmark.java
Sat Mar 12 13:51:45 2005
@@ -282,9 +282,12 @@
             
             String name = trace[i].getClassName();
 
-            if ( name.startsWith( "org.apache.commons.benchmark" ) == false )
+            if ( name.startsWith( "org.apache.commons.benchmark" ) == false ) {
                 return name;
-            
+            } else if ( name.indexOf( "Test" ) != -1 ) {
+                return name;
+            }
+
         }
 
         return null;

Modified: jakarta/commons/sandbox/benchmark/trunk/src/java/org/apache/commons/benchmark/rrd/GraphTask.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/benchmark/trunk/src/java/org/apache/commons/benchmark/rrd/GraphTask.java?view=diff&r1=157284&r2=157285
==============================================================================
--- jakarta/commons/sandbox/benchmark/trunk/src/java/org/apache/commons/benchmark/rrd/GraphTask.java
(original)
+++ jakarta/commons/sandbox/benchmark/trunk/src/java/org/apache/commons/benchmark/rrd/GraphTask.java
Sat Mar 12 13:51:45 2005
@@ -58,11 +58,6 @@
     private String rrd_path = null;
 
     /**
-     * The current RRD sample...
-     */
-    private Sample sample = null;
-
-    /**
      * Unit title and description.
      */
     private String unit_desc, unit_name = null;
@@ -288,16 +283,25 @@
         }
         
         RrdDb rrdDb = new RrdDb( rrd_path );
-        sample = rrdDb.createSample();
+        Sample sample = rrdDb.createSample();
 
         try {
 
-            data( source.getValue() );
-            //value += 10;
-            //data( value );
-            rrdDb.sync();
-            rrdDb.close();
-            
+            long v = source.getValue();
+
+            //NOTE: this is the correct mechanism but it might be off by a bit due
+            //to skew with running getValue() from diff impls...
+            //lastUpdatedSeconds = currentTimeSeconds();
+
+            lastUpdatedSeconds += GraphTaskRunner.COUNTER_INTERVAL_SECONDS;
+        
+            String time = formatTime( lastUpdatedSeconds );
+
+            System.out.println( "time: " + time + " , " + unit_name + " value: " + v );
+            System.out.println( "lastUpdated: " + lastUpdatedSeconds );
+        
+            sample.setAndUpdate( lastUpdatedSeconds + ":" + v );
+
         } finally {
 
             rrdDb.sync();
@@ -330,25 +334,5 @@
             }
         }        
     }
-    
-    /**
-     * Take the RRD and call setAndUpdate on it with the given value.
-     */
-    public void data( long v ) throws Exception {
-
-        //NOTE: this is the correct mechanism but it might be off by a bit due
-        //to skew with running getValue() from diff impls...
-        //lastUpdatedSeconds = currentTimeSeconds();
 
-        lastUpdatedSeconds += GraphTaskRunner.COUNTER_INTERVAL_SECONDS;
-        
-        String time = formatTime( lastUpdatedSeconds );
-
-        System.out.println( "time: " + time + " , " + unit_name + " value: " + v );
-        System.out.println( "lastUpdated: " + lastUpdatedSeconds );
-        
-        sample.setAndUpdate( lastUpdatedSeconds + ":" + v );
-        
-    }
-    
 }

Modified: jakarta/commons/sandbox/benchmark/trunk/xdocs/index.xml
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/benchmark/trunk/xdocs/index.xml?view=diff&r1=157284&r2=157285
==============================================================================
--- jakarta/commons/sandbox/benchmark/trunk/xdocs/index.xml (original)
+++ jakarta/commons/sandbox/benchmark/trunk/xdocs/index.xml Sat Mar 12 13:51:45 2005
@@ -59,7 +59,7 @@
                 
                 <dt>Proprietary</dt>
 
-            </ol>
+            </dl>
 
             <p>
                 Infrasture code such as rrdtool, ganglia, and jrobin, provide
@@ -80,6 +80,8 @@
                     <li>A graphing package based on JRobin</li>
 
                 </ol>
+
+            </p>
 
         </section>
 



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message