activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jstrac...@apache.org
Subject svn commit: r412483 - in /incubator/activemq/trunk/tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool: JmsPerformanceSupport.java PerfMeasurable.java PerfMeasurementTool.java
Date Wed, 07 Jun 2006 18:40:19 GMT
Author: jstrachan
Date: Wed Jun  7 11:40:19 2006
New Revision: 412483

URL: http://svn.apache.org/viewvc?rev=412483&view=rev
Log:
refactored the XML output of the performance tests a little to make it XML compliant and to
add a client index so its easy to render the XML in tables etc

Modified:
    incubator/activemq/trunk/tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/JmsPerformanceSupport.java
    incubator/activemq/trunk/tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/PerfMeasurable.java
    incubator/activemq/trunk/tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/PerfMeasurementTool.java

Modified: incubator/activemq/trunk/tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/JmsPerformanceSupport.java
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/JmsPerformanceSupport.java?rev=412483&r1=412482&r2=412483&view=diff
==============================================================================
--- incubator/activemq/trunk/tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/JmsPerformanceSupport.java
(original)
+++ incubator/activemq/trunk/tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/JmsPerformanceSupport.java
Wed Jun  7 11:40:19 2006
@@ -22,13 +22,22 @@
 
 public class JmsPerformanceSupport extends JmsClientSupport implements PerfMeasurable {
 
+    private static int clientCounter;
+    
     protected AtomicLong throughput = new AtomicLong(0);
-
     protected PerfEventListener listener = null;
+    private int clientNumber;
 
     public void reset() {
         setThroughput(0);
     }
+    
+    public synchronized int getClientNumber() {
+        if (clientNumber == 0) {
+            clientNumber = incrementClientCounter();
+        }
+        return clientNumber;
+    }
 
     public String getClientName() {
         try {
@@ -60,5 +69,9 @@
 
     public PerfEventListener getPerfEventListener() {
         return listener;
+    }
+
+    protected static synchronized int incrementClientCounter() {
+        return ++clientCounter;
     }
 }

Modified: incubator/activemq/trunk/tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/PerfMeasurable.java
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/PerfMeasurable.java?rev=412483&r1=412482&r2=412483&view=diff
==============================================================================
--- incubator/activemq/trunk/tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/PerfMeasurable.java
(original)
+++ incubator/activemq/trunk/tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/PerfMeasurable.java
Wed Jun  7 11:40:19 2006
@@ -20,6 +20,7 @@
 
 public interface PerfMeasurable {
     public void reset();
+    public int getClientNumber();
     public String getClientName();
     public long getThroughput();
     public Properties getSettings();

Modified: incubator/activemq/trunk/tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/PerfMeasurementTool.java
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/PerfMeasurementTool.java?rev=412483&r1=412482&r2=412483&view=diff
==============================================================================
--- incubator/activemq/trunk/tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/PerfMeasurementTool.java
(original)
+++ incubator/activemq/trunk/tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/PerfMeasurementTool.java
Wed Jun  7 11:40:19 2006
@@ -169,8 +169,8 @@
     public void sampleClients() {
         for (Iterator i = perfClients.iterator(); i.hasNext();) {
             PerfMeasurable client = (PerfMeasurable) i.next();
-            getWriter().println("<sample index=" + sampleIndex + " name=" + client.getClientName()
+
-                    " throughput=" + client.getThroughput() + "/>");
+            getWriter().println("<sample index='" + sampleIndex + "' clientNumber='" +
 client.getClientNumber() 
+                    + "' name='" + client.getClientName() + "' throughput='" + client.getThroughput()
+ "'/>");
             client.reset();
         }
     }



Mime
View raw message