commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bur...@apache.org
Subject svn commit: r157468 - in jakarta/commons/sandbox/benchmark/trunk: src/java/org/apache/commons/benchmark/BenchmarkMeta.java src/java/org/apache/commons/benchmark/BenchmarkUtils.java xdocs/index.xml
Date Mon, 14 Mar 2005 21:40:10 GMT
Author: burton
Date: Mon Mar 14 13:40:09 2005
New Revision: 157468

URL: http://svn.apache.org/viewcvs?view=rev&rev=157468
Log:
changed to package level with getters/setters

Modified:
    jakarta/commons/sandbox/benchmark/trunk/src/java/org/apache/commons/benchmark/BenchmarkMeta.java
    jakarta/commons/sandbox/benchmark/trunk/src/java/org/apache/commons/benchmark/BenchmarkUtils.java
    jakarta/commons/sandbox/benchmark/trunk/xdocs/index.xml

Modified: jakarta/commons/sandbox/benchmark/trunk/src/java/org/apache/commons/benchmark/BenchmarkMeta.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/benchmark/trunk/src/java/org/apache/commons/benchmark/BenchmarkMeta.java?view=diff&r1=157467&r2=157468
==============================================================================
--- jakarta/commons/sandbox/benchmark/trunk/src/java/org/apache/commons/benchmark/BenchmarkMeta.java
(original)
+++ jakarta/commons/sandbox/benchmark/trunk/src/java/org/apache/commons/benchmark/BenchmarkMeta.java
Mon Mar 14 13:40:09 2005
@@ -25,13 +25,13 @@
  */
 public class BenchmarkMeta {
 
-    public long timestamp = -1;
+    long timestamp = -1;
 
-    public long started = 0;
+    long started = 0;
 
-    public long completed = 0;
+    long completed = 0;
 
-    public long duration = 0;
+    long duration = 0;
     
     /**
      * The time the current benchmark was started.  -1 for never started.

Modified: jakarta/commons/sandbox/benchmark/trunk/src/java/org/apache/commons/benchmark/BenchmarkUtils.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/benchmark/trunk/src/java/org/apache/commons/benchmark/BenchmarkUtils.java?view=diff&r1=157467&r2=157468
==============================================================================
--- jakarta/commons/sandbox/benchmark/trunk/src/java/org/apache/commons/benchmark/BenchmarkUtils.java
(original)
+++ jakarta/commons/sandbox/benchmark/trunk/src/java/org/apache/commons/benchmark/BenchmarkUtils.java
Mon Mar 14 13:40:09 2005
@@ -50,8 +50,6 @@
                                                        int numIterations,
                                                        Class clazz ) throws Exception {
 
-        System.gc();
-
         Method method = clazz.getMethod( name, null );
 
         if ( method == null )
@@ -60,6 +58,7 @@
         BenchmarkMethodMeta bmeta = new BenchmarkMethodMeta();
         bmeta.name = name;
 
+        System.gc();
         bmeta.memoryBefore = getUsedMemory();
         long duration = 0;
 

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=157467&r2=157468
==============================================================================
--- jakarta/commons/sandbox/benchmark/trunk/xdocs/index.xml (original)
+++ jakarta/commons/sandbox/benchmark/trunk/xdocs/index.xml Mon Mar 14 13:40:09 2005
@@ -120,16 +120,17 @@
             
             <source>
                 
-                Benchmark benchmark = Benchmark.getBenchmark( "foo" );
+                //get a benchmark
+                Benchmark benchmark = Benchmark.getBenchmark( "my_benchmark_name" );
                 
                 try {
                 
-                benchmark.start();
+                    benchmark.start();
                 
-                //do something expensive
+                    //do something expensive
                 
                 } finally {
-                benchmark.complete();
+                    benchmark.complete();
                 }
                 
             </source>
@@ -141,6 +142,15 @@
                 overhead.
             </p>
 
+            <p>
+                We provide shortcuts for determining the benchmark name from the
+                caller.  For example if youre class
+                is <code>mypackage.MyClass</code> and you call
+                <code>Benchmark.getBenchmark()</code> or simply <code>new
+                Benchmark()</code> we automatically determine the class name and
+                use this as the name of the benchmark.
+            </p>
+
         </section>
 
         <section name="Proxy Benchmarks">
@@ -276,7 +286,20 @@
                     <td>
                         no
                     </td>
+                </tr>
+
+                <tr>
+                    <td>
+                        xmlrpc
+                    </td>
+
+                    <td>
+                        no
+                    </td>
 
+                    <td>
+                        yes
+                    </td>
                 </tr>
 
             </table>



---------------------------------------------------------------------
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