commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bur...@apache.org
Subject svn commit: r156285 - in jakarta/commons/sandbox/benchmark/trunk/src/java/org/apache/commons/benchmark: Benchmark.java BenchmarkTracker.java xmlrpc/ xmlrpc/BenchmarkHandler.java
Date Sat, 05 Mar 2005 22:52:42 GMT
Author: burton
Date: Sat Mar  5 14:52:41 2005
New Revision: 156285

URL: http://svn.apache.org/viewcvs?view=rev&rev=156285
Log:
XMLRPC handler for fetching benchmarks from a remote VM

Added:
    jakarta/commons/sandbox/benchmark/trunk/src/java/org/apache/commons/benchmark/xmlrpc/
    jakarta/commons/sandbox/benchmark/trunk/src/java/org/apache/commons/benchmark/xmlrpc/BenchmarkHandler.java
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/BenchmarkTracker.java

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=156284&r2=156285
==============================================================================
--- 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  5 14:52:41 2005
@@ -96,7 +96,7 @@
      * We support keeping track of local values between start/complete such as
      * duration. We can disable this for additional throughput.  Enabling this
      * feature uses threadlocal variables so there's a constant overhead per
-     * thread. 
+     * thread.
      */
     public static boolean DISABLE_LOCAL = true;
     
@@ -311,15 +311,22 @@
 
     public String toString() {
         return "1min: " +
-            "current=("  +
+            "now=("  +
+            "started:" +
             getTracker1().getStarted() +
             "," +
+            "completed:" +
             getTracker1().getCompleted() +
+            "," +
+            "duration:" +
+            getTracker1().getDuration() +
             ")" + 
             " " +
             "last=("  +
+            "started:" +
             getTracker1().getLastStarted() +
             "," +
+            "completed:" +
             getTracker1().getLastCompleted() +
             ")";
             

Modified: jakarta/commons/sandbox/benchmark/trunk/src/java/org/apache/commons/benchmark/BenchmarkTracker.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/benchmark/trunk/src/java/org/apache/commons/benchmark/BenchmarkTracker.java?view=diff&r1=156284&r2=156285
==============================================================================
--- jakarta/commons/sandbox/benchmark/trunk/src/java/org/apache/commons/benchmark/BenchmarkTracker.java
(original)
+++ jakarta/commons/sandbox/benchmark/trunk/src/java/org/apache/commons/benchmark/BenchmarkTracker.java
Sat Mar  5 14:52:41 2005
@@ -251,6 +251,10 @@
     
 }
 
+/**
+ * Threadlocal which hold BenchmarkThreadLocalClosures.
+ *
+ */
 class BenchmarkThreadLocal extends ThreadLocal {
 
     public Object initialValue() {

Added: jakarta/commons/sandbox/benchmark/trunk/src/java/org/apache/commons/benchmark/xmlrpc/BenchmarkHandler.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/benchmark/trunk/src/java/org/apache/commons/benchmark/xmlrpc/BenchmarkHandler.java?view=auto&rev=156285
==============================================================================
--- jakarta/commons/sandbox/benchmark/trunk/src/java/org/apache/commons/benchmark/xmlrpc/BenchmarkHandler.java
(added)
+++ jakarta/commons/sandbox/benchmark/trunk/src/java/org/apache/commons/benchmark/xmlrpc/BenchmarkHandler.java
Sat Mar  5 14:52:41 2005
@@ -0,0 +1,53 @@
+/*
+ * Copyright 1999,2004 The Apache Software Foundation.
+ * 
+ * Licensed 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.benchmark.xmlrpc;
+
+import java.io.*;
+import java.util.*;
+import java.net.*;
+
+import org.apache.commons.benchmark.*;
+
+/**
+ * Jakarta XMLRPC handler for working and fetching benchmarks from a remote VM.
+ * 
+ * @author <a href="mailto:burton@rojo.com">Kevin A. Burton (burtonator)</a>
+ * @version $Id: BenchmarkHandler.java,v 1.5 2005/03/04 00:31:08 burton Exp $
+ */
+public class BenchmarkHandler {
+    
+    public Double getTotalStarted( String name ) {
+        return new Double( Benchmark.getBenchmark( name ).getTotalStarted() );
+    }
+
+    public Double getTotalCompleted( String name ) {
+        return new Double( Benchmark.getBenchmark( name ).getTotalCompleted() );
+    }
+
+    public Double getTotalStarted( String name, int interval ) {
+
+        return new Double( Benchmark.getBenchmark( name )
+                               .getTracker1().getTotalStarted() );
+    }
+
+    public Double getTotalCompleted( String name, int interval ) {
+        return new Double( Benchmark.getBenchmark( name )
+                               .getTracker1().getTotalCompleted() );
+    }
+
+}
+



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