activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From foco...@apache.org
Subject svn commit: r412046 - in /incubator/activemq/trunk: activemq-perftest/ tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/
Date Tue, 06 Jun 2006 08:43:14 GMT
Author: foconer
Date: Tue Jun  6 01:43:13 2006
New Revision: 412046

URL: http://svn.apache.org/viewvc?rev=412046&view=rev
Log:
Changes:
1. Filename includes some config info of client.
2. Additional test information in the generated report.

Modified:
    incubator/activemq/trunk/activemq-perftest/pom.xml
    incubator/activemq/trunk/tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/JmsClientSystemSupport.java
    incubator/activemq/trunk/tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/JmsConsumerSystem.java
    incubator/activemq/trunk/tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/JmsProducerSystem.java
    incubator/activemq/trunk/tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/PerfReportGenerator.java

Modified: incubator/activemq/trunk/activemq-perftest/pom.xml
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-perftest/pom.xml?rev=412046&r1=412045&r2=412046&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-perftest/pom.xml (original)
+++ incubator/activemq/trunk/activemq-perftest/pom.xml Tue Jun  6 01:43:13 2006
@@ -19,7 +19,7 @@
             <plugin>
                 <groupId>incubator-activemq</groupId>
                 <artifactId>maven-activemq-perf-plugin</artifactId>
-                <version>4.0-SNAPSHOT</version>
+                <version>4.1-SNAPSHOT</version>
             </plugin>
         </plugins>
     </build>

Modified: incubator/activemq/trunk/tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/JmsClientSystemSupport.java
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/JmsClientSystemSupport.java?rev=412046&r1=412045&r2=412046&view=diff
==============================================================================
--- incubator/activemq/trunk/tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/JmsClientSystemSupport.java
(original)
+++ incubator/activemq/trunk/tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/JmsClientSystemSupport.java
Tue Jun  6 01:43:13 2006
@@ -50,8 +50,8 @@
         performanceSampler.setSamplerSettings(samplerSettings);
 
         PerfReportGenerator report = new PerfReportGenerator();
-        report.setReportDirectory(this.getReportDirectory());
-        report.setReportName(this.getClass().toString());
+        report.setReportName(this.getClass().getCanonicalName());
+        report.setTestSettings(getSettings());
         report.startGenerateReport();
 
         performanceSampler.setDataOutputStream(report.getDataOutputStream());

Modified: incubator/activemq/trunk/tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/JmsConsumerSystem.java
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/JmsConsumerSystem.java?rev=412046&r1=412045&r2=412046&view=diff
==============================================================================
--- incubator/activemq/trunk/tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/JmsConsumerSystem.java
(original)
+++ incubator/activemq/trunk/tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/JmsConsumerSystem.java
Tue Jun  6 01:43:13 2006
@@ -31,7 +31,7 @@
             sampler.registerClient(consumer);
             consumer.setPerfEventListener(sampler);
         }
-
+        
         try {
             consumer.receiveMessages();
         } catch (JMSException e) {
@@ -52,7 +52,7 @@
     }
 
     public static void main(String[] args) throws JMSException {
-        /*String[] options = new String[24];
+        /*String[] options = new String[25];
         options[0] = "-Dsampler.duration=60000";     // 1 min
         options[1] = "-Dsampler.interval=5000";      // 5 secs
         options[2] = "-Dsampler.rampUpTime=10000";   // 10 secs
@@ -81,6 +81,7 @@
         options[21] = "-DsysTest.numClients=5";
         options[22] = "-DsysTest.totalDests=5";
         options[23] = "-DsysTest.destDistro=all";
+        options[24] = "-DsysTest.reportDirectory=./target/test-perf";
 
         args = options;*/
 
@@ -97,7 +98,6 @@
         }
 
         JmsConsumerSystem sysTest = new JmsConsumerSystem();
-        sysTest.setReportDirectory("./target/Test-perf");
         sysTest.setSettings(sysSettings);
         sysTest.runSystemTest();
     }

Modified: incubator/activemq/trunk/tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/JmsProducerSystem.java
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/JmsProducerSystem.java?rev=412046&r1=412045&r2=412046&view=diff
==============================================================================
--- incubator/activemq/trunk/tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/JmsProducerSystem.java
(original)
+++ incubator/activemq/trunk/tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/JmsProducerSystem.java
Tue Jun  6 01:43:13 2006
@@ -52,7 +52,7 @@
     }
 
     public static void main(String[] args) {
-        /*String[] options = new String[19];
+        /*String[] options = new String[20];
         options[0] = "-Dsampler.duration=60000";     // 1 min
         options[1] = "-Dsampler.interval=5000";      // 5 secs
         options[2] = "-Dsampler.rampUpTime=10000";   // 10 secs
@@ -76,8 +76,9 @@
         options[16] = "-DsysTest.numClients=5";
         options[17] = "-DsysTest.totalDests=5";
         options[18] = "-DsysTest.destDistro=all";
+        options[19] = "-DsysTest.reportDirectory=./target/test-perf";
 
-        args = options;*/
+        args = options; */
 
         Properties sysSettings  = new Properties();
 
@@ -93,7 +94,6 @@
         }
 
         JmsProducerSystem sysTest = new JmsProducerSystem();
-        sysTest.setReportDirectory("./target/Test-perf");
         sysTest.setSettings(sysSettings);
         sysTest.runSystemTest();
     }

Modified: incubator/activemq/trunk/tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/PerfReportGenerator.java
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/PerfReportGenerator.java?rev=412046&r1=412045&r2=412046&view=diff
==============================================================================
--- incubator/activemq/trunk/tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/PerfReportGenerator.java
(original)
+++ incubator/activemq/trunk/tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/PerfReportGenerator.java
Tue Jun  6 01:43:13 2006
@@ -5,6 +5,8 @@
 import java.io.FileOutputStream;
 import java.io.IOException;
 import java.util.Properties;
+import java.util.Enumeration;
+import java.util.Iterator;
 
 /**
  * Created by IntelliJ IDEA.
@@ -18,7 +20,8 @@
     private String reportDirectory = null;
     private String reportName = null;
     private DataOutputStream dataOutputStream = null;
-    private Properties clientSetting;
+
+    private Properties testSettings;
 
     public PerfReportGenerator() {
     }
@@ -30,8 +33,7 @@
 
     public void startGenerateReport() {
 
-        setReportDirectory(reportDirectory);
-        setReportName(reportName);
+        setReportDirectory(this.getTestSettings().getProperty("sysTest.reportDirectory"));
 
         File reportDir = new File(getReportDirectory());
 
@@ -42,7 +44,8 @@
 
         File reportFile = null;
         if (reportDir != null) {
-            reportFile = new File(reportDirectory + File.separator + reportName + ".xml");
+            String filename = (this.getReportName()).substring(this.getReportName().lastIndexOf(".")+1)+"-"+createReportName(getTestSettings());
+            reportFile = new File(this.getReportDirectory() + File.separator + filename +
".xml");
         }
 
         try {
@@ -68,8 +71,26 @@
 
         buffer.append("<test-report>\n");
         buffer.append("<test-information>\n");
+
         buffer.append("<os-name>" + System.getProperty("os.name") + "</os-name>\n");
         buffer.append("<java-version>" + System.getProperty("java.version") + "</java-version>\n");
+
+        if(this.getTestSettings()!=null){
+            Enumeration keys = getTestSettings().propertyNames();
+
+            buffer.append("<client-settings>\n");
+
+            String key;
+            String key2;
+            while(keys.hasMoreElements()){
+                key = (String) keys.nextElement();
+                key2 = key.substring(key.indexOf(".")+1);
+                buffer.append("<" + key2 +">" + getTestSettings().get(key) + "</"
+ key2 +">\n");
+            }
+
+            buffer.append("</client-settings>\n");
+        }
+
         buffer.append("</test-information>\n");
         buffer.append("<test-result>\n");
 
@@ -93,7 +114,39 @@
         return reportName;
     }
 
+    public String createReportName(Properties testSettings) {
+        if(testSettings!=null){
+            String[] keys = {"client.destCount","consumer.asyncRecv","consumer.durable",
+                             "producer.messageSize","sysTest.numClients","sysTest.totalDests"};
+
+            StringBuffer buffer = new StringBuffer();
+            String key;
+            String val;
+            String temp;
+            for(int i=0;i<keys.length;i++){
+                key = keys[i];
+                val = testSettings.getProperty(key);
+
+                if(val==null)continue;
+
+                temp = key.substring(key.indexOf(".")+1);
+                buffer.append(temp+val);
+            }
+
+            return buffer.toString();
+        }
+        return null;
+    }
+
     public void setReportName(String reportName) {
         this.reportName = reportName;
+    }
+
+    public Properties getTestSettings() {
+        return testSettings;
+    }
+
+    public void setTestSettings(Properties testSettings) {
+        this.testSettings = testSettings;
     }
 }



Mime
View raw message