mirror of https://github.com/apache/activemq.git
Changes:
1. Filename includes some config info of client. 2. Additional test information in the generated report. git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/trunk@412046 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
fa37910edd
commit
52602f0377
|
@ -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>
|
||||
|
|
|
@ -50,8 +50,8 @@ public abstract class JmsClientSystemSupport {
|
|||
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());
|
||||
|
|
|
@ -52,7 +52,7 @@ public class JmsConsumerSystem extends JmsClientSystemSupport {
|
|||
}
|
||||
|
||||
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 @@ public class JmsConsumerSystem extends JmsClientSystemSupport {
|
|||
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 @@ public class JmsConsumerSystem extends JmsClientSystemSupport {
|
|||
}
|
||||
|
||||
JmsConsumerSystem sysTest = new JmsConsumerSystem();
|
||||
sysTest.setReportDirectory("./target/Test-perf");
|
||||
sysTest.setSettings(sysSettings);
|
||||
sysTest.runSystemTest();
|
||||
}
|
||||
|
|
|
@ -52,7 +52,7 @@ public class JmsProducerSystem extends JmsClientSystemSupport {
|
|||
}
|
||||
|
||||
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,6 +76,7 @@ public class JmsProducerSystem extends JmsClientSystemSupport {
|
|||
options[16] = "-DsysTest.numClients=5";
|
||||
options[17] = "-DsysTest.totalDests=5";
|
||||
options[18] = "-DsysTest.destDistro=all";
|
||||
options[19] = "-DsysTest.reportDirectory=./target/test-perf";
|
||||
|
||||
args = options; */
|
||||
|
||||
|
@ -93,7 +94,6 @@ public class JmsProducerSystem extends JmsClientSystemSupport {
|
|||
}
|
||||
|
||||
JmsProducerSystem sysTest = new JmsProducerSystem();
|
||||
sysTest.setReportDirectory("./target/Test-perf");
|
||||
sysTest.setSettings(sysSettings);
|
||||
sysTest.runSystemTest();
|
||||
}
|
||||
|
|
|
@ -5,6 +5,8 @@ import java.io.File;
|
|||
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 @@ public class PerfReportGenerator {
|
|||
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 class PerfReportGenerator {
|
|||
|
||||
public void startGenerateReport() {
|
||||
|
||||
setReportDirectory(reportDirectory);
|
||||
setReportName(reportName);
|
||||
setReportDirectory(this.getTestSettings().getProperty("sysTest.reportDirectory"));
|
||||
|
||||
File reportDir = new File(getReportDirectory());
|
||||
|
||||
|
@ -42,7 +44,8 @@ public class PerfReportGenerator {
|
|||
|
||||
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 @@ public class PerfReportGenerator {
|
|||
|
||||
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 @@ public class PerfReportGenerator {
|
|||
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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue