summaryrefslogtreecommitdiff
path: root/java/perftests
diff options
context:
space:
mode:
authorKeith Wall <kwall@apache.org>2012-12-20 17:32:49 +0000
committerKeith Wall <kwall@apache.org>2012-12-20 17:32:49 +0000
commit7156c84f1c6ebc6ad2bfaa9bbbc09f2abf8b295e (patch)
treeb337db688c0ce50871f5664d032327fafb39a9bf /java/perftests
parent2c5c3e98f5b42fd757ba2943bb6cb67fcff83810 (diff)
downloadqpid-python-7156c84f1c6ebc6ad2bfaa9bbbc09f2abf8b295e.tar.gz
NO-JIRA: [Java Broker] Added new perf test script to test the varying consumer/producer batch size independently of the other. This simulates a use-case that has been problematic for previous Qpid versions.
Changed visualisation-jfc to allow the perf-test result summary page title to be specified from the command line. Converted BatchSize script from JSON to Javascript. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1424600 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/perftests')
-rw-r--r--java/perftests/etc/chartdefs/1030-BatchSize-Equal.chartdef (renamed from java/perftests/etc/chartdefs/1030-BatchSize.chartdef)13
-rw-r--r--java/perftests/etc/chartdefs/1031-BatchSize-Unequal.chartdef53
-rw-r--r--java/perftests/etc/testdefs/BatchSize.js102
-rw-r--r--java/perftests/etc/testdefs/BatchSize.json84
-rw-r--r--java/perftests/etc/testdefs/BatchSizeConsumerVaries.js102
-rw-r--r--java/perftests/etc/testdefs/BatchSizeProducerVaries.js102
-rw-r--r--java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/ChartingUtil.java7
-rw-r--r--java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/writer/ChartWriter.java8
-rw-r--r--java/perftests/visualisation-jfc/src/test/java/org/apache/qpid/disttest/charting/writer/ChartWriterTest.java4
9 files changed, 377 insertions, 98 deletions
diff --git a/java/perftests/etc/chartdefs/1030-BatchSize.chartdef b/java/perftests/etc/chartdefs/1030-BatchSize-Equal.chartdef
index 17d15fbf81..97b712e027 100644
--- a/java/perftests/etc/chartdefs/1030-BatchSize.chartdef
+++ b/java/perftests/etc/chartdefs/1030-BatchSize-Equal.chartdef
@@ -4,35 +4,34 @@
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
+# '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
+# '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.
#
chartType=XYLINE
-chartTitle=Transaction Batch Size
+chartTitle=Transaction Batch Sizes Equal
chartSubtitle=Persistent 1KB messages
-chartDescription=1P 1C, persistent, transacted with message payload 1KB and batch sizes 1-100 messages
+chartDescription=1P 1C, persistent, transacted with message payload 1KB with producer/consumer batch size varying between 1-400 messages for both P and C
xAxisTitle=Batch Size
yAxisTitle=Throughput (messages/s)
series.1.statement=SELECT batchSize, throughputMessagesPerS FROM BatchSize WHERE participantName = 'All'
-series.1.legend=Current
+series.1.legend=Equal Producer/Consumer
series.1.dir=${csvCurrentDir}
series.1.colourName=red
series.2.statement=SELECT batchSize, throughputMessagesPerS FROM BatchSize WHERE participantName = 'All'
-series.2.legend=Baseline
+series.2.legend=Equal Producer/Consumer (Baseline)
series.2.dir=${csvBaselineDir}
series.2.colourName=dark_red
series.2.strokeWidth=-1
-
diff --git a/java/perftests/etc/chartdefs/1031-BatchSize-Unequal.chartdef b/java/perftests/etc/chartdefs/1031-BatchSize-Unequal.chartdef
new file mode 100644
index 0000000000..51b3bb2144
--- /dev/null
+++ b/java/perftests/etc/chartdefs/1031-BatchSize-Unequal.chartdef
@@ -0,0 +1,53 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you 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.
+#
+
+chartType=XYLINE
+chartTitle=Transaction Batch Size Unequal
+chartSubtitle=Persistent 1KB messages
+chartDescription=1P 1C, persistent, transacted with message payload 1KB with fixed batch size 1 for one party whilst other varies between 1-400 messages
+
+xAxisTitle=Batch Size
+yAxisTitle=Throughput (messages/s)
+
+#
+# If csvjdbc could do sub-selects (allowing us to extract the consumer/producer batch size from the All Consumers/All Producers rows),
+# we would not need the workaround where we have testdef place the consumer/producer batch size into testName field
+#
+
+series.1.statement=SELECT testName, throughputMessagesPerS FROM BatchSizeProducerVaries WHERE participantName = 'All'
+series.1.legend=Variable Producer, Fixed Consumer
+series.1.dir=${csvCurrentDir}
+series.1.colourName=red
+
+series.2.statement=SELECT testName, throughputMessagesPerS FROM BatchSizeProducerVaries WHERE participantName = 'All'
+series.2.legend=Variable Producer, Fixed Consumer (Baseline)
+series.2.dir=${csvBaselineDir}
+series.2.colourName=dark_red
+series.2.strokeWidth=-1
+
+series.3.statement=SELECT testName, throughputMessagesPerS FROM BatchSizeConsumerVaries WHERE participantName = 'All'
+series.3.legend=Fixed Producer, Variable Consumer
+series.3.dir=${csvCurrentDir}
+series.3.colourName=blue
+
+series.4.statement=SELECT testName, throughputMessagesPerS FROM BatchSizeConsumerVaries WHERE participantName = 'All'
+series.4.legend=Fixed Producer, Variable Consumer (Baseline)
+series.4.dir=${csvBaselineDir}
+series.4.colourName=dark_blue
+series.4.strokeWidth=-1
diff --git a/java/perftests/etc/testdefs/BatchSize.js b/java/perftests/etc/testdefs/BatchSize.js
new file mode 100644
index 0000000000..f17751b7b5
--- /dev/null
+++ b/java/perftests/etc/testdefs/BatchSize.js
@@ -0,0 +1,102 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
+ *
+ */
+
+var jsonObject = {
+ _tests:[]
+};
+
+var duration = 30000;
+
+var txBatchSizes = [[1,1], [2,2], [5,5], [10,10], [20,20], [50,50], [100,100], [200,200], [400,400]];
+
+var acknowledgeMode = 0;
+var deliveryMode = 2;
+var messageSize = 1024;
+
+for(i=0; i < txBatchSizes.length ; i++)
+{
+ var producerBatchSize = txBatchSizes[i][0];
+ var consumerBatchSize = txBatchSizes[i][1];
+ var queueName = "txBatchSize" + producerBatchSize + "_" + consumerBatchSize;
+ var destination = "direct://amq.direct//" + queueName + "?durable='true'";
+
+ var test = {
+ "_name": "Batch Size " + producerBatchSize + "-" + consumerBatchSize + " - PERSISTENT",
+ "_queues":[
+ {
+ "_name": queueName,
+ "_durable": true
+ }
+ ],
+ "_clients":[
+ {
+ "_name": "producingClient",
+ "_connections":[
+ {
+ "_name": "connection1",
+ "_factory": "connectionfactory",
+ "_sessions": [
+ {
+ "_sessionName": "session1",
+ "_acknowledgeMode": acknowledgeMode,
+ "_producers": [
+ {
+ "_name": "Producer1",
+ "_destinationName": destination,
+ "_messageSize": messageSize,
+ "_deliveryMode": deliveryMode,
+ "_batchSize": producerBatchSize,
+ "_maximumDuration": duration
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "_name": "consumingClient",
+ "_connections":[
+ {
+ "_name": "connection1",
+ "_factory": "connectionfactory",
+ "_sessions": [
+ {
+ "_sessionName": "session1",
+ "_acknowledgeMode": acknowledgeMode,
+ "_consumers": [
+ {
+ "_name": "Consumer1",
+ "_destinationName": destination,
+ "_batchSize": consumerBatchSize,
+ "_maximumDuration": duration
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ };
+
+ jsonObject._tests= jsonObject._tests.concat(test);
+}
diff --git a/java/perftests/etc/testdefs/BatchSize.json b/java/perftests/etc/testdefs/BatchSize.json
deleted file mode 100644
index eeb446bad6..0000000000
--- a/java/perftests/etc/testdefs/BatchSize.json
+++ /dev/null
@@ -1,84 +0,0 @@
-{
- "_tests":[
- {
- "_name": "Batch Size- PERSISTENT";
- "_iterations":[
- {
- "_batchSize": 1
- },
- {
- "_batchSize": 2
- },
- {
- "_batchSize": 5
- },
- {
- "_batchSize": 10
- },
- {
- "_batchSize": 20
- },
- {
- "_batchSize": 50
- },
- {
- "_batchSize": 100
- }
- ],
- "_queues":[
- {
- "_name": "direct://amq.direct//batchSize?durable='true'",
- "_durable": true
- }
- ],
- "_clients":[
- {
- "_name": "producingClient",
- "_connections":[
- {
- "_name": "connection1",
- "_factory": "connectionfactory",
- "_sessions": [
- {
- "_sessionName": "session1",
- "_acknowledgeMode": 0,
- "_producers": [
- {
- "_name": "Producer1",
- "_destinationName": "direct://amq.direct//batchSize?durable='true'",
- "_messageSize": 1024,
- "_maximumDuration": 30000,
- "_deliveryMode": 2
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "_name": "consumingClient",
- "_connections":[
- {
- "_name": "connection1",
- "_factory": "connectionfactory",
- "_sessions": [
- {
- "_sessionName": "session1",
- "_acknowledgeMode": 0,
- "_consumers": [
- {
- "_name": "Consumer1",
- "_destinationName": "direct://amq.direct//batchSize?durable='true'",
- "_maximumDuration": 30000
- }
- ]
- }
- ]
- }
- ]
- }
- ]
- }
- ]
-}
diff --git a/java/perftests/etc/testdefs/BatchSizeConsumerVaries.js b/java/perftests/etc/testdefs/BatchSizeConsumerVaries.js
new file mode 100644
index 0000000000..b491f431c9
--- /dev/null
+++ b/java/perftests/etc/testdefs/BatchSizeConsumerVaries.js
@@ -0,0 +1,102 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
+ *
+ */
+
+var jsonObject = {
+ _tests:[]
+};
+
+var duration = 30000;
+
+var txBatchSizes = [[1,1], [1,2], [1,5], [1,10], [1,20], [1,50], [1,100], [1,200], [1,400]];
+
+var acknowledgeMode = 0;
+var deliveryMode = 2;
+var messageSize = 1024;
+
+for(i=0; i < txBatchSizes.length ; i++)
+{
+ var producerBatchSize = txBatchSizes[i][0];
+ var consumerBatchSize = txBatchSizes[i][1];
+ var queueName = "txBatchSize" + producerBatchSize + "_" + consumerBatchSize;
+ var destination = "direct://amq.direct//" + queueName + "?durable='true'";
+
+ var test = {
+ "_name": consumerBatchSize,// hack - use test name to expose the consumer batch size on the All result rows
+ "_queues":[
+ {
+ "_name": queueName,
+ "_durable": true
+ }
+ ],
+ "_clients":[
+ {
+ "_name": "producingClient",
+ "_connections":[
+ {
+ "_name": "connection1",
+ "_factory": "connectionfactory",
+ "_sessions": [
+ {
+ "_sessionName": "session1",
+ "_acknowledgeMode": acknowledgeMode,
+ "_producers": [
+ {
+ "_name": "Producer1",
+ "_destinationName": destination,
+ "_messageSize": messageSize,
+ "_deliveryMode": deliveryMode,
+ "_batchSize": producerBatchSize,
+ "_maximumDuration": duration
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "_name": "consumingClient",
+ "_connections":[
+ {
+ "_name": "connection1",
+ "_factory": "connectionfactory",
+ "_sessions": [
+ {
+ "_sessionName": "session1",
+ "_acknowledgeMode": acknowledgeMode,
+ "_consumers": [
+ {
+ "_name": "Consumer1",
+ "_destinationName": destination,
+ "_batchSize": consumerBatchSize,
+ "_maximumDuration": duration
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ };
+
+ jsonObject._tests= jsonObject._tests.concat(test);
+}
diff --git a/java/perftests/etc/testdefs/BatchSizeProducerVaries.js b/java/perftests/etc/testdefs/BatchSizeProducerVaries.js
new file mode 100644
index 0000000000..ac23c52c9e
--- /dev/null
+++ b/java/perftests/etc/testdefs/BatchSizeProducerVaries.js
@@ -0,0 +1,102 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
+ *
+ */
+
+var jsonObject = {
+ _tests:[]
+};
+
+var duration = 30000;
+
+var txBatchSizes = [[1,1], [2,1], [5,1], [10,1], [20,1], [50,1], [100,1], [200,1], [400,1]];
+
+var acknowledgeMode = 0;
+var deliveryMode = 2;
+var messageSize = 1024;
+
+for(i=0; i < txBatchSizes.length ; i++)
+{
+ var producerBatchSize = txBatchSizes[i][0];
+ var consumerBatchSize = txBatchSizes[i][1];
+ var queueName = "txBatchSize" + producerBatchSize + "_" + consumerBatchSize;
+ var destination = "direct://amq.direct//" + queueName + "?durable='true'";
+
+ var test = {
+ "_name": producerBatchSize,// hack - use test name to expose the producer batch size on the All result rows
+ "_queues":[
+ {
+ "_name": queueName,
+ "_durable": true
+ }
+ ],
+ "_clients":[
+ {
+ "_name": "producingClient",
+ "_connections":[
+ {
+ "_name": "connection1",
+ "_factory": "connectionfactory",
+ "_sessions": [
+ {
+ "_sessionName": "session1",
+ "_acknowledgeMode": acknowledgeMode,
+ "_producers": [
+ {
+ "_name": "Producer1",
+ "_destinationName": destination,
+ "_messageSize": messageSize,
+ "_deliveryMode": deliveryMode,
+ "_batchSize": producerBatchSize,
+ "_maximumDuration": duration
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "_name": "consumingClient",
+ "_connections":[
+ {
+ "_name": "connection1",
+ "_factory": "connectionfactory",
+ "_sessions": [
+ {
+ "_sessionName": "session1",
+ "_acknowledgeMode": acknowledgeMode,
+ "_consumers": [
+ {
+ "_name": "Consumer1",
+ "_destinationName": destination,
+ "_batchSize": consumerBatchSize,
+ "_maximumDuration": duration
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ };
+
+ jsonObject._tests= jsonObject._tests.concat(test);
+}
diff --git a/java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/ChartingUtil.java b/java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/ChartingUtil.java
index 82a3a8c140..a329f33b00 100644
--- a/java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/ChartingUtil.java
+++ b/java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/ChartingUtil.java
@@ -58,10 +58,14 @@ public class ChartingUtil
public static final String CHART_DEFINITIONS_PROP = "chart-defs";
public static final String CHART_DEFINITIONS_DEFAULT = ".";
+ public static final String SUMMARY_TITLE_PROP = "summary-title";
+ public static final String SUMMARY_TITLE_DEFAULT = "Performance Charts";
+
private Map<String,String> _cliOptions = new HashMap<String, String>();
{
_cliOptions.put(OUTPUT_DIR_PROP, OUTPUT_DIR_DEFAULT);
_cliOptions.put(CHART_DEFINITIONS_PROP, CHART_DEFINITIONS_DEFAULT);
+ _cliOptions.put(SUMMARY_TITLE_PROP, SUMMARY_TITLE_DEFAULT);
}
public static void main(String[] args) throws Exception
@@ -101,7 +105,8 @@ public class ChartingUtil
writer.writeChartToFileSystem(chart, chartingDefinition);
}
- writer.writeHtmlSummaryToFileSystem();
+ final String summaryChartTitle = _cliOptions.get(SUMMARY_TITLE_PROP);
+ writer.writeHtmlSummaryToFileSystem(summaryChartTitle);
}
private List<ChartingDefinition> loadChartDefinitions(String chartingDefsDir)
diff --git a/java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/writer/ChartWriter.java b/java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/writer/ChartWriter.java
index 69997a051c..888d7dc3d7 100644
--- a/java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/writer/ChartWriter.java
+++ b/java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/writer/ChartWriter.java
@@ -79,7 +79,7 @@ public class ChartWriter
}
}
- public void writeHtmlSummaryToFileSystem()
+ public void writeHtmlSummaryToFileSystem(String summaryPageTitle)
{
if(_chartFilesToChartDef.size() < 2)
{
@@ -87,13 +87,13 @@ public class ChartWriter
return;
}
- String htmlHeader =
+ String htmlHeader = String.format(
"<html>\n" +
" <head>\n" +
- " <title>Performance Charts</title>\n" +
+ " <title>%s</title>\n" +
" <style type='text/css'>figure { float: left; display: table; width: 87px;}</style>\n" +
" </head>\n" +
- " <body>\n";
+ " <body>\n", summaryPageTitle);
String htmlFooter =
" </body>\n" +
diff --git a/java/perftests/visualisation-jfc/src/test/java/org/apache/qpid/disttest/charting/writer/ChartWriterTest.java b/java/perftests/visualisation-jfc/src/test/java/org/apache/qpid/disttest/charting/writer/ChartWriterTest.java
index b515e70f2c..4a249e252e 100644
--- a/java/perftests/visualisation-jfc/src/test/java/org/apache/qpid/disttest/charting/writer/ChartWriterTest.java
+++ b/java/perftests/visualisation-jfc/src/test/java/org/apache/qpid/disttest/charting/writer/ChartWriterTest.java
@@ -91,7 +91,7 @@ public class ChartWriterTest extends TestCase
_writer.writeChartToFileSystem(_chart2, chartDef2);
_writer.writeChartToFileSystem(_chart1, chartDef1);
- _writer.writeHtmlSummaryToFileSystem();
+ _writer.writeHtmlSummaryToFileSystem("Performance Charts");
InputStream expectedSummaryFileInputStream = getClass().getResourceAsStream("expected-chart-summary.html");
String expectedSummaryContent = new Scanner(expectedSummaryFileInputStream).useDelimiter("\\A").next();
@@ -110,7 +110,7 @@ public class ChartWriterTest extends TestCase
_writer.writeChartToFileSystem(_chart1, chartDef1);
- _writer.writeHtmlSummaryToFileSystem();
+ _writer.writeHtmlSummaryToFileSystem("Performance Charts");
assertFalse("Only one chart generated so no summary file should have been written",
summaryFile.exists());