From 9c73ef7a5ac10acd6a50d5d52bd721fc2faa5919 Mon Sep 17 00:00:00 2001
From: Kim van der Riet
Date: Thu, 28 Feb 2013 16:14:30 +0000
Subject: Update from trunk r1375509 through r1450773
git-svn-id: https://svn.apache.org/repos/asf/qpid/branches/asyncstore@1451244 13f79535-47bb-0310-9956-ffa450edef68
---
java/perftests/build.xml | 2 +-
.../1001-MessageSize-Transient-ByteSec.chartdef | 37 ++
.../chartdefs/1001-MessageSize-Transient.chartdef | 32 --
.../1002-MessageSize-Persistent-ByteSec.chartdef | 37 ++
.../chartdefs/1002-MessageSize-Persistent.chartdef | 32 --
.../1003-MessageSize-Transient-MsgSec.chartdef | 37 ++
.../1004-MessageSize-Persistent-MsgSec.chartdef | 37 ++
.../1011-VaryingNumberOfProducers-AutoAck.chartdef | 47 +++
.../1011-VaryingNumberOfProducers.chartdef | 40 --
.../1012-VaryingNumberOfConsumers-AutoAck.chartdef | 47 +++
.../1012-VaryingNumberOfConsumers.chartdef | 40 --
...-VaryingNumberOfProducers-SessionTrans.chartdef | 47 +++
...-VaryingNumberOfConsumers-SessionTrans.chartdef | 47 +++
.../1021-AcknowledgementModes-Persistent.chartdef | 13 +-
.../1022-AcknowledgementModes-Transient.chartdef | 10 +-
.../etc/chartdefs/1030-BatchSize-Equal.chartdef | 37 ++
.../etc/chartdefs/1030-BatchSize.chartdef | 33 --
.../etc/chartdefs/1031-BatchSize-Unequal.chartdef | 53 +++
.../etc/chartdefs/1040-QueueTypes.chartdef | 10 +-
...mberOfProducerSessionsSingleConnection.chartdef | 49 +++
...sWithNonOverlappingSelectors-Transient.chartdef | 37 ++
...WithNonOverlappingSelectors-Persistent.chartdef | 43 ++
...mersWithOverlappingSelectors-Transient.chartdef | 36 ++
...ersWithOverlappingSelectors-Persistent.chartdef | 42 ++
.../1500-Topic-NumberOfConsumers.chartdef | 11 +-
.../chartdefs/1501-Topic-NumberOfTopics.chartdef | 11 +-
.../etc/chartdefs/1502-Topic-Persistence.chartdef | 13 +-
.../etc/chartdefs/1503-Topic-AckModes.chartdef | 13 +-
.../2001-Latency-MessageSize-Transient.chartdef | 6 +
.../2002-Latency-MessageSize-Persistent.chartdef | 6 +
...sWithNonOverlappingSelectors-Transient.chartdef | 6 +
...euesWithOverlappingSelectors-Transient.chartdef | 6 +
...WithNonOverlappingSelectors-Persistent.chartdef | 6 +
...uesWithOverlappingSelectors-Persistent.chartdef | 6 +
...31-Latency-VaryingNumberOfParticipants.chartdef | 7 +
.../etc/chartdefs/2041-Latency-QueueTypes.chartdef | 6 +
.../1001-Large-Messages-Transient.chartdef | 29 ++
.../1002-Large-Messages-Persistent.chartdef | 29 ++
...ltipleProducersAndConsumers-Persistent.chartdef | 30 ++
.../timeseries/1030-Batch-Size-Small.chartdef | 30 ++
.../timeseries/1031-Batch-Size-Large.chartdef | 30 ++
.../chartdefs/timeseries/1040-SortedQueue.chartdef | 30 ++
java/perftests/etc/perftests-jndi.properties | 4 +
java/perftests/etc/run-perftests.sh | 37 ++
java/perftests/etc/testdefs/BatchSize.js | 102 +++++
java/perftests/etc/testdefs/BatchSize.json | 84 ----
.../etc/testdefs/BatchSizeConsumerVaries.js | 102 +++++
.../etc/testdefs/BatchSizeProducerVaries.js | 102 +++++
.../QueueConsumersWithNonOverlappingSelectors.js | 120 ++++++
.../QueueConsumersWithOverlappingSelectors.js | 131 ++++++
java/perftests/etc/testdefs/Topic-AckModes.js | 9 +-
.../etc/testdefs/Topic-NumberOfConsumers.js | 4 +
.../perftests/etc/testdefs/Topic-NumberOfTopics.js | 4 +
java/perftests/etc/testdefs/Topic-Persistence.js | 8 +-
.../etc/testdefs/VaryingNumberOfParticipants.json | 272 ++++++------
...yingNumberOfProducerSessionsSingleConnection.js | 95 +++++
java/perftests/etc/visualisation-timeseries.sh | 33 ++
java/perftests/etc/visualisation.sh | 35 ++
java/perftests/example/brokerconfig/log4j.xml | 2 +-
java/perftests/example/perftests-jndi.properties | 3 +
java/perftests/example/run.sh | 2 +-
.../org/apache/qpid/disttest/ArgumentParser.java | 6 +-
.../org/apache/qpid/disttest/ConfigFileHelper.java | 11 -
.../org/apache/qpid/disttest/ControllerRunner.java | 84 ++--
.../apache/qpid/disttest/ResultsFileWriter.java | 112 +++++
.../qpid/disttest/client/ConsumerParticipant.java | 17 +-
.../qpid/disttest/client/ParticipantExecutor.java | 10 +-
.../qpid/disttest/client/ProducerParticipant.java | 56 ++-
.../qpid/disttest/controller/ClientRegistry.java | 36 +-
.../disttest/controller/ResultsForAllTests.java | 21 +
.../disttest/controller/config/ConsumerConfig.java | 6 +-
.../controller/config/ParticipantConfig.java | 4 +
.../disttest/controller/config/ProducerConfig.java | 2 +-
.../apache/qpid/disttest/db/ResultsDbWriter.java | 467 +++++++++++++++++++++
.../qpid/disttest/jms/ClientJmsDelegate.java | 64 ++-
.../qpid/disttest/jms/ControllerJmsDelegate.java | 4 +-
.../apache/qpid/disttest/jms/NoOpQueueCreator.java | 5 +-
.../apache/qpid/disttest/jms/QpidQueueCreator.java | 101 ++++-
.../org/apache/qpid/disttest/jms/QueueCreator.java | 5 +-
.../message/ConsumerParticipantResult.java | 4 +
.../disttest/message/CreateConsumerCommand.java | 11 -
.../disttest/message/CreateParticpantCommand.java | 11 +
.../disttest/message/ParticipantAttribute.java | 42 +-
.../qpid/disttest/message/ParticipantResult.java | 54 ++-
.../message/ProducerParticipantResult.java | 4 +-
.../disttest/results/aggregation/ITestResult.java | 2 -
.../aggregation/ParticipantResultAggregator.java | 11 +
.../results/aggregation/TestResultAggregator.java | 24 ++
.../disttest/results/formatting/CSVFormater.java | 89 ----
.../disttest/results/formatting/CSVFormatter.java | 91 ++++
.../apache/qpid/disttest/ConfigFileHelperTest.java | 8 -
.../qpid/disttest/ResultsFileWriterTest.java | 85 ++++
.../java/org/apache/qpid/disttest/VisitorTest.java | 5 +-
.../disttest/client/ClientCommandVisitorTest.java | 4 +-
.../apache/qpid/disttest/client/ClientTest.java | 5 +-
.../disttest/client/ConsumerParticipantTest.java | 15 +-
.../qpid/disttest/client/MessageProviderTest.java | 5 +-
.../disttest/client/ParticipantExecutorTest.java | 25 +-
.../disttest/client/ParticipantRegistryTest.java | 5 +-
.../client/ParticipantResultFactoryTest.java | 5 +-
.../disttest/client/ProducerParticipantTest.java | 34 +-
.../client/property/ListPropertyValueTest.java | 8 +-
.../client/property/PropertyValueFactoryTest.java | 4 +-
.../client/property/RandomPropertyValueTest.java | 6 +-
.../client/property/RangePropertyValueTest.java | 6 +-
.../client/property/SimplePropertyValueTest.java | 4 +-
.../client/utils/ExecutorWithNoLimitsTest.java | 4 +-
.../client/utils/ExecutorWithTimeLimitTest.java | 6 +-
.../disttest/controller/ClientRegistryTest.java | 44 +-
.../qpid/disttest/controller/ControllerTest.java | 10 +-
.../controller/ParticipatingClientsTest.java | 4 +-
.../qpid/disttest/controller/TestRunnerTest.java | 5 +-
.../controller/config/ClientConfigTest.java | 5 +-
.../config/ConfigReaderTest-test-config.js | 22 +-
.../controller/config/ConfigReaderTest.java | 9 +-
.../disttest/controller/config/ConfigTest.java | 4 +-
.../controller/config/ConnectionConfigTest.java | 5 +-
.../controller/config/ConsumerConfigTest.java | 5 +-
.../JavaScriptConfigEvaluatorTest-test-config.js | 22 +-
.../config/JavaScriptConfigEvaluatorTest.java | 7 +-
.../config/MessageProviderConfigTest.java | 5 +-
.../controller/config/ParticipantConfigTest.java | 2 +-
.../controller/config/ProducerConfigTest.java | 5 +-
.../controller/config/SessionConfigTest.java | 5 +-
.../disttest/controller/config/TestConfigTest.java | 5 +-
.../controller/config/TestInstanceTest.java | 5 +-
.../qpid/disttest/db/ResultsDbWriterTest.java | 158 +++++++
.../qpid/disttest/jms/JmsMessageAdaptorTest.java | 5 +-
.../qpid/disttest/message/JsonHandlerTest.java | 5 +-
.../disttest/message/ParticipantResultTest.java | 11 +-
.../qpid/disttest/results/ResultsTestFixture.java | 138 ++++++
.../results/aggregation/AggregatorTest.java | 5 +-
.../ParticipantResultAggregatorTest.java | 30 +-
.../results/aggregation/SeriesStatisticsTest.java | 4 +-
.../aggregation/TestResultAggregatorTest.java | 45 +-
.../results/formatting/CSVFormaterTest.java | 146 -------
.../results/formatting/CSVFormatterTest.java | 62 +++
.../CSVOrderParticipantResultComparatorTest.java | 6 +-
.../disttest/results/formatting/expectedOutput.csv | 4 +-
.../systest/disttest/QpidQueueCreatorTest.java | 42 +-
.../qpid/systest/disttest/SystemTestConstants.java | 6 +-
.../systest/disttest/endtoend/EndToEndTest.java | 13 +-
.../systest/disttest/perftests.systests.properties | 3 +
java/perftests/visualisation-jfc/build.xml | 4 +-
.../apache/qpid/disttest/charting/ChartType.java | 2 +-
.../qpid/disttest/charting/ChartingUtil.java | 67 ++-
.../charting/chartbuilder/BarChart3DBuilder.java | 2 +-
.../charting/chartbuilder/BarChartBuilder.java | 2 +-
.../charting/chartbuilder/BaseChartBuilder.java | 72 +++-
.../CategoryDataSetBasedChartBuilder.java | 60 +--
.../CategoryStrokeAndPaintApplier.java | 41 ++
.../charting/chartbuilder/ChartBuilderFactory.java | 4 +-
.../charting/chartbuilder/ColorFactory.java | 66 +++
.../charting/chartbuilder/LineChart3DBuilder.java | 2 +-
.../charting/chartbuilder/LineChartBuilder.java | 2 +-
.../charting/chartbuilder/SeriesPainter.java | 63 +++
.../chartbuilder/SeriesStrokeAndPaintApplier.java | 35 ++
.../chartbuilder/StatisticalBarCharBuilder.java | 111 -----
.../chartbuilder/StatisticalBarChartBuilder.java | 114 +++++
.../charting/chartbuilder/TimeSeriesHolder.java | 70 +++
.../chartbuilder/TimeSeriesLineChartBuilder.java | 59 +++
.../chartbuilder/XYDataSetBasedChartBuilder.java | 70 +--
.../charting/definition/ChartingDefinition.java | 12 +-
.../definition/ChartingDefinitionCreator.java | 6 +-
.../charting/definition/SeriesDefinition.java | 27 +-
.../definition/SeriesDefinitionCreator.java | 7 +-
.../charting/seriesbuilder/DatasetHolder.java | 37 ++
.../seriesbuilder/JdbcCsvSeriesBuilder.java | 141 -------
.../charting/seriesbuilder/JdbcSeriesBuilder.java | 157 +++++++
.../charting/seriesbuilder/JdbcUrlGenerator.java | 81 ++++
.../charting/seriesbuilder/SeriesBuilder.java | 15 +-
.../seriesbuilder/SeriesBuilderCallback.java | 30 --
.../disttest/charting/seriesbuilder/SeriesRow.java | 98 +++++
.../qpid/disttest/charting/writer/ChartWriter.java | 44 +-
.../chartbuilder/BaseChartBuilderTest.java | 125 ++++++
.../chartbuilder/ChartBuilderFactoryTest.java | 13 +-
.../charting/chartbuilder/ChartProductionTest.java | 130 +++---
.../charting/chartbuilder/ColorFactoryTest.java | 42 ++
.../TimeSeriesBuilderCallbackTest.java | 72 ++++
.../definition/ChartingDefinitionCreatorTest.java | 13 +-
.../definition/SeriesDefinitionCreatorTest.java | 32 +-
.../seriesbuilder/JdbcCsvSeriesBuilderTest.java | 94 -----
.../seriesbuilder/JdbcSeriesBuilderTest.java | 103 +++++
.../seriesbuilder/JdbcUrlGeneratorTest.java | 85 ++++
.../charting/seriesbuilder/SeriesRowTest.java | 64 +++
.../disttest/charting/writer/ChartWriterTest.java | 35 +-
.../charting/writer/expected-chart-summary.html | 14 +-
187 files changed, 5443 insertions(+), 1589 deletions(-)
create mode 100644 java/perftests/etc/chartdefs/1001-MessageSize-Transient-ByteSec.chartdef
delete mode 100644 java/perftests/etc/chartdefs/1001-MessageSize-Transient.chartdef
create mode 100644 java/perftests/etc/chartdefs/1002-MessageSize-Persistent-ByteSec.chartdef
delete mode 100644 java/perftests/etc/chartdefs/1002-MessageSize-Persistent.chartdef
create mode 100644 java/perftests/etc/chartdefs/1003-MessageSize-Transient-MsgSec.chartdef
create mode 100644 java/perftests/etc/chartdefs/1004-MessageSize-Persistent-MsgSec.chartdef
create mode 100644 java/perftests/etc/chartdefs/1011-VaryingNumberOfProducers-AutoAck.chartdef
delete mode 100644 java/perftests/etc/chartdefs/1011-VaryingNumberOfProducers.chartdef
create mode 100644 java/perftests/etc/chartdefs/1012-VaryingNumberOfConsumers-AutoAck.chartdef
delete mode 100644 java/perftests/etc/chartdefs/1012-VaryingNumberOfConsumers.chartdef
create mode 100644 java/perftests/etc/chartdefs/1015-VaryingNumberOfProducers-SessionTrans.chartdef
create mode 100644 java/perftests/etc/chartdefs/1016-VaryingNumberOfConsumers-SessionTrans.chartdef
create mode 100644 java/perftests/etc/chartdefs/1030-BatchSize-Equal.chartdef
delete mode 100644 java/perftests/etc/chartdefs/1030-BatchSize.chartdef
create mode 100644 java/perftests/etc/chartdefs/1031-BatchSize-Unequal.chartdef
create mode 100644 java/perftests/etc/chartdefs/1050-VaryingNumberOfProducerSessionsSingleConnection.chartdef
create mode 100644 java/perftests/etc/chartdefs/1300-QueueConsumersWithNonOverlappingSelectors-Transient.chartdef
create mode 100644 java/perftests/etc/chartdefs/1301-QueueConsumersWithNonOverlappingSelectors-Persistent.chartdef
create mode 100644 java/perftests/etc/chartdefs/1302-QueueConsumersWithOverlappingSelectors-Transient.chartdef
create mode 100644 java/perftests/etc/chartdefs/1303-QueueConsumersWithOverlappingSelectors-Persistent.chartdef
create mode 100644 java/perftests/etc/chartdefs/timeseries/1001-Large-Messages-Transient.chartdef
create mode 100644 java/perftests/etc/chartdefs/timeseries/1002-Large-Messages-Persistent.chartdef
create mode 100644 java/perftests/etc/chartdefs/timeseries/1011-MultipleProducersAndConsumers-Persistent.chartdef
create mode 100644 java/perftests/etc/chartdefs/timeseries/1030-Batch-Size-Small.chartdef
create mode 100644 java/perftests/etc/chartdefs/timeseries/1031-Batch-Size-Large.chartdef
create mode 100644 java/perftests/etc/chartdefs/timeseries/1040-SortedQueue.chartdef
create mode 100755 java/perftests/etc/run-perftests.sh
create mode 100644 java/perftests/etc/testdefs/BatchSize.js
delete mode 100644 java/perftests/etc/testdefs/BatchSize.json
create mode 100644 java/perftests/etc/testdefs/BatchSizeConsumerVaries.js
create mode 100644 java/perftests/etc/testdefs/BatchSizeProducerVaries.js
create mode 100644 java/perftests/etc/testdefs/QueueConsumersWithNonOverlappingSelectors.js
create mode 100644 java/perftests/etc/testdefs/QueueConsumersWithOverlappingSelectors.js
create mode 100644 java/perftests/etc/testdefs/VaryingNumberOfProducerSessionsSingleConnection.js
create mode 100755 java/perftests/etc/visualisation-timeseries.sh
create mode 100755 java/perftests/etc/visualisation.sh
create mode 100644 java/perftests/src/main/java/org/apache/qpid/disttest/ResultsFileWriter.java
create mode 100644 java/perftests/src/main/java/org/apache/qpid/disttest/db/ResultsDbWriter.java
delete mode 100644 java/perftests/src/main/java/org/apache/qpid/disttest/results/formatting/CSVFormater.java
create mode 100644 java/perftests/src/main/java/org/apache/qpid/disttest/results/formatting/CSVFormatter.java
create mode 100644 java/perftests/src/test/java/org/apache/qpid/disttest/ResultsFileWriterTest.java
create mode 100644 java/perftests/src/test/java/org/apache/qpid/disttest/db/ResultsDbWriterTest.java
create mode 100644 java/perftests/src/test/java/org/apache/qpid/disttest/results/ResultsTestFixture.java
delete mode 100644 java/perftests/src/test/java/org/apache/qpid/disttest/results/formatting/CSVFormaterTest.java
create mode 100644 java/perftests/src/test/java/org/apache/qpid/disttest/results/formatting/CSVFormatterTest.java
create mode 100644 java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/chartbuilder/CategoryStrokeAndPaintApplier.java
create mode 100644 java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/chartbuilder/ColorFactory.java
create mode 100644 java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/chartbuilder/SeriesPainter.java
create mode 100644 java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/chartbuilder/SeriesStrokeAndPaintApplier.java
delete mode 100644 java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/chartbuilder/StatisticalBarCharBuilder.java
create mode 100644 java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/chartbuilder/StatisticalBarChartBuilder.java
create mode 100644 java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/chartbuilder/TimeSeriesHolder.java
create mode 100644 java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/chartbuilder/TimeSeriesLineChartBuilder.java
create mode 100644 java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/seriesbuilder/DatasetHolder.java
delete mode 100644 java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/seriesbuilder/JdbcCsvSeriesBuilder.java
create mode 100644 java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/seriesbuilder/JdbcSeriesBuilder.java
create mode 100644 java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/seriesbuilder/JdbcUrlGenerator.java
delete mode 100644 java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/seriesbuilder/SeriesBuilderCallback.java
create mode 100644 java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/seriesbuilder/SeriesRow.java
create mode 100644 java/perftests/visualisation-jfc/src/test/java/org/apache/qpid/disttest/charting/chartbuilder/BaseChartBuilderTest.java
create mode 100644 java/perftests/visualisation-jfc/src/test/java/org/apache/qpid/disttest/charting/chartbuilder/ColorFactoryTest.java
create mode 100644 java/perftests/visualisation-jfc/src/test/java/org/apache/qpid/disttest/charting/chartbuilder/TimeSeriesBuilderCallbackTest.java
delete mode 100644 java/perftests/visualisation-jfc/src/test/java/org/apache/qpid/disttest/charting/seriesbuilder/JdbcCsvSeriesBuilderTest.java
create mode 100644 java/perftests/visualisation-jfc/src/test/java/org/apache/qpid/disttest/charting/seriesbuilder/JdbcSeriesBuilderTest.java
create mode 100644 java/perftests/visualisation-jfc/src/test/java/org/apache/qpid/disttest/charting/seriesbuilder/JdbcUrlGeneratorTest.java
create mode 100644 java/perftests/visualisation-jfc/src/test/java/org/apache/qpid/disttest/charting/seriesbuilder/SeriesRowTest.java
(limited to 'java/perftests')
diff --git a/java/perftests/build.xml b/java/perftests/build.xml
index c59986c06d..d29649ad68 100644
--- a/java/perftests/build.xml
+++ b/java/perftests/build.xml
@@ -33,7 +33,7 @@
-
+
diff --git a/java/perftests/etc/chartdefs/1001-MessageSize-Transient-ByteSec.chartdef b/java/perftests/etc/chartdefs/1001-MessageSize-Transient-ByteSec.chartdef
new file mode 100644
index 0000000000..7559b5934e
--- /dev/null
+++ b/java/perftests/etc/chartdefs/1001-MessageSize-Transient-ByteSec.chartdef
@@ -0,0 +1,37 @@
+#
+# 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=Impact of Message Size Bytes/S
+chartSubtitle=Transient messages
+chartDescription=1P 1C, transient, auto-ack, with message payload between 256-262144 bytes.
+
+xAxisTitle=Message Size (B)
+yAxisTitle=Throughput (KB/s)
+
+series.1.statement=SELECT payloadSizeB, throughputKbPerS FROM MessageSize WHERE testName like '%TRANSIENT' AND participantName = 'All'
+series.1.legend=Current
+series.1.dir=${csvCurrentDir}
+series.1.colourName=red
+
+series.2.statement=SELECT payloadSizeB, throughputKbPerS FROM MessageSize WHERE testName like '%TRANSIENT' AND participantName = 'All'
+series.2.legend=Baseline
+series.2.dir=${csvBaselineDir}
+series.2.colourName=dark_red
+series.2.strokeWidth=-1
diff --git a/java/perftests/etc/chartdefs/1001-MessageSize-Transient.chartdef b/java/perftests/etc/chartdefs/1001-MessageSize-Transient.chartdef
deleted file mode 100644
index 757a396dff..0000000000
--- a/java/perftests/etc/chartdefs/1001-MessageSize-Transient.chartdef
+++ /dev/null
@@ -1,32 +0,0 @@
-#
-# 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=Impact of Message Size
-chartSubtitle=Transient messages
-xAxisTitle=Message Size (B)
-yAxisTitle=Throughput (KB/s)
-
-series.1.statement=SELECT payloadSizeB, throughputKbPerS FROM MessageSize WHERE testName like '%TRANSIENT' AND participantName = 'All'
-series.1.legend=Current
-series.1.dir=${csvCurrentDir}
-
-series.2.statement=SELECT payloadSizeB, throughputKbPerS FROM MessageSize WHERE testName like '%TRANSIENT' AND participantName = 'All'
-series.2.legend=Baseline
-series.2.dir=${csvBaselineDir}
diff --git a/java/perftests/etc/chartdefs/1002-MessageSize-Persistent-ByteSec.chartdef b/java/perftests/etc/chartdefs/1002-MessageSize-Persistent-ByteSec.chartdef
new file mode 100644
index 0000000000..db8a5f3896
--- /dev/null
+++ b/java/perftests/etc/chartdefs/1002-MessageSize-Persistent-ByteSec.chartdef
@@ -0,0 +1,37 @@
+#
+# 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=Impact of Message Size Bytes/S
+chartSubtitle=Persistent messages
+chartDescription=1P 1C, persistent, auto-ack, with message payload between 256-262144 bytes.
+
+xAxisTitle=Message Size (B)
+yAxisTitle=Throughput (KB/s)
+
+series.1.statement=SELECT payloadSizeB, throughputKbPerS FROM MessageSize WHERE testName like '% PERSISTENT' AND participantName = 'All'
+series.1.legend=Current
+series.1.dir=${csvCurrentDir}
+series.1.colourName=red
+
+series.2.statement=SELECT payloadSizeB, throughputKbPerS FROM MessageSize WHERE testName like '% PERSISTENT' AND participantName = 'All'
+series.2.legend=Baseline
+series.2.dir=${csvBaselineDir}
+series.2.colourName=dark_red
+series.2.strokeWidth=-1
diff --git a/java/perftests/etc/chartdefs/1002-MessageSize-Persistent.chartdef b/java/perftests/etc/chartdefs/1002-MessageSize-Persistent.chartdef
deleted file mode 100644
index 58c280e227..0000000000
--- a/java/perftests/etc/chartdefs/1002-MessageSize-Persistent.chartdef
+++ /dev/null
@@ -1,32 +0,0 @@
-#
-# 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=Impact of Message Size
-chartSubtitle=Persistent messages
-xAxisTitle=Message Size (B)
-yAxisTitle=Throughput (KB/s)
-
-series.1.statement=SELECT payloadSizeB, throughputKbPerS FROM MessageSize WHERE testName like '% PERSISTENT' AND participantName = 'All'
-series.1.legend=Current
-series.1.dir=${csvCurrentDir}
-
-series.2.statement=SELECT payloadSizeB, throughputKbPerS FROM MessageSize WHERE testName like '% PERSISTENT' AND participantName = 'All'
-series.2.legend=Baseline
-series.2.dir=${csvBaselineDir}
diff --git a/java/perftests/etc/chartdefs/1003-MessageSize-Transient-MsgSec.chartdef b/java/perftests/etc/chartdefs/1003-MessageSize-Transient-MsgSec.chartdef
new file mode 100644
index 0000000000..7f18fcc986
--- /dev/null
+++ b/java/perftests/etc/chartdefs/1003-MessageSize-Transient-MsgSec.chartdef
@@ -0,0 +1,37 @@
+#
+# 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=Impact of Message Size
+chartSubtitle=Transient messages
+chartDescription=1P 1C, transient, auto-ack, with message payload between 256-262144 bytes.
+
+xAxisTitle=Message Size (B)
+yAxisTitle=Throughput (messages/s)
+
+series.1.statement=SELECT payloadSizeB, throughputMessagesPerS FROM MessageSize WHERE testName like '%TRANSIENT' AND participantName = 'All'
+series.1.legend=Current
+series.1.dir=${csvCurrentDir}
+series.1.colourName=red
+
+series.2.statement=SELECT payloadSizeB, throughputMessagesPerS FROM MessageSize WHERE testName like '%TRANSIENT' AND participantName = 'All'
+series.2.legend=Baseline
+series.2.dir=${csvBaselineDir}
+series.2.colourName=dark_red
+series.2.strokeWidth=-1
diff --git a/java/perftests/etc/chartdefs/1004-MessageSize-Persistent-MsgSec.chartdef b/java/perftests/etc/chartdefs/1004-MessageSize-Persistent-MsgSec.chartdef
new file mode 100644
index 0000000000..667be044bc
--- /dev/null
+++ b/java/perftests/etc/chartdefs/1004-MessageSize-Persistent-MsgSec.chartdef
@@ -0,0 +1,37 @@
+#
+# 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=Impact of Message Size
+chartSubtitle=Persistent messages
+chartDescription=1P 1C, persistent, auto-ack, with message payload between 256-262144 bytes.
+
+xAxisTitle=Message Size (B)
+yAxisTitle=Throughput (messages/s)
+
+series.1.statement=SELECT payloadSizeB, throughputMessagesPerS FROM MessageSize WHERE testName like '% PERSISTENT' AND participantName = 'All'
+series.1.legend=Current
+series.1.dir=${csvCurrentDir}
+series.2.colourName=red
+
+series.2.statement=SELECT payloadSizeB, throughputMessagesPerS FROM MessageSize WHERE testName like '% PERSISTENT' AND participantName = 'All'
+series.2.legend=Baseline
+series.2.dir=${csvBaselineDir}
+series.2.colourName=dark_red
+series.2.strokeWidth=-1
diff --git a/java/perftests/etc/chartdefs/1011-VaryingNumberOfProducers-AutoAck.chartdef b/java/perftests/etc/chartdefs/1011-VaryingNumberOfProducers-AutoAck.chartdef
new file mode 100644
index 0000000000..b3038c1671
--- /dev/null
+++ b/java/perftests/etc/chartdefs/1011-VaryingNumberOfProducers-AutoAck.chartdef
@@ -0,0 +1,47 @@
+#
+# 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=Varying number of producers - auto ack
+chartSubtitle=Persistent 1KB messages
+chartDescription=1,2,5,10 P/Cs, persistent, auto-ack, with message payload 1KB.
+
+xAxisTitle=Producers
+yAxisTitle=Throughput (messages/s)
+
+series.1.statement=SELECT totalNumberOfProducers, throughputMessagesPerS FROM VaryingNumberOfParticipants WHERE participantName = 'All' and totalNumberOfConsumers = '1' and acknowledgeMode = '1'
+series.1.legend=1 Consumer
+series.1.dir=${csvCurrentDir}
+series.1.colourName=red
+
+series.2.statement=SELECT totalNumberOfProducers, throughputMessagesPerS FROM VaryingNumberOfParticipants WHERE participantName = 'All' and totalNumberOfConsumers = '5' and acknowledgeMode = '1'
+series.2.legend=5 Consumer
+series.2.dir=${csvCurrentDir}
+series.2.colourName=blue
+
+series.3.statement=SELECT totalNumberOfProducers, throughputMessagesPerS FROM VaryingNumberOfParticipants WHERE participantName = 'All' and totalNumberOfConsumers = '10' and acknowledgeMode = '1'
+series.3.legend=10 Consumer
+series.3.dir=${csvCurrentDir}
+series.3.colourName=green
+
+series.4.statement=SELECT totalNumberOfProducers, throughputMessagesPerS FROM VaryingNumberOfParticipants WHERE participantName = 'All' and totalNumberOfConsumers = '1' and acknowledgeMode = '1'
+series.4.legend=1 Consumer (baseline)
+series.4.dir=${csvBaselineDir}
+series.4.colourName=dark_red
+series.4.strokeWidth=-1
diff --git a/java/perftests/etc/chartdefs/1011-VaryingNumberOfProducers.chartdef b/java/perftests/etc/chartdefs/1011-VaryingNumberOfProducers.chartdef
deleted file mode 100644
index f39e7c3d0d..0000000000
--- a/java/perftests/etc/chartdefs/1011-VaryingNumberOfProducers.chartdef
+++ /dev/null
@@ -1,40 +0,0 @@
-#
-# 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=Varying number of producers
-chartSubtitle=Persistent 1KB messages
-xAxisTitle=Producers
-yAxisTitle=Throughput (KB/s)
-
-series.1.statement=SELECT totalNumberOfProducers, throughputKbPerS FROM VaryingNumberOfParticipants WHERE participantName = 'All' and totalNumberOfConsumers = '1'
-series.1.legend=1 Consumer
-series.1.dir=${csvCurrentDir}
-
-series.2.statement=SELECT totalNumberOfProducers, throughputKbPerS FROM VaryingNumberOfParticipants WHERE participantName = 'All' and totalNumberOfConsumers = '5'
-series.2.legend=5 Consumer
-series.2.dir=${csvCurrentDir}
-
-series.3.statement=SELECT totalNumberOfProducers, throughputKbPerS FROM VaryingNumberOfParticipants WHERE participantName = 'All' and totalNumberOfConsumers = '10'
-series.3.legend=10 Consumer
-series.3.dir=${csvCurrentDir}
-
-series.4.statement=SELECT totalNumberOfProducers, throughputKbPerS FROM VaryingNumberOfParticipants WHERE participantName = 'All' and totalNumberOfConsumers = '1'
-series.4.legend=1 Consumer (baseline)
-series.4.dir=${csvBaselineDir}
diff --git a/java/perftests/etc/chartdefs/1012-VaryingNumberOfConsumers-AutoAck.chartdef b/java/perftests/etc/chartdefs/1012-VaryingNumberOfConsumers-AutoAck.chartdef
new file mode 100644
index 0000000000..d1f3d6e9a4
--- /dev/null
+++ b/java/perftests/etc/chartdefs/1012-VaryingNumberOfConsumers-AutoAck.chartdef
@@ -0,0 +1,47 @@
+#
+# 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=Varying number of consumers - auto ack
+chartSubtitle=Persistent 1KB messages
+chartDescription=1,2,5,10 P/Cs, persistent, auto-ack, with message payload 1KB.
+
+xAxisTitle=Consumers
+yAxisTitle=Throughput (messages/s)
+
+series.1.statement=SELECT totalNumberOfConsumers, throughputMessagesPerS FROM VaryingNumberOfParticipants WHERE participantName = 'All' and totalNumberOfProducers = '1' and acknowledgeMode = '1'
+series.1.legend=1 Producer
+series.1.dir=${csvCurrentDir}
+series.1.colourName=blue
+
+series.2.statement=SELECT totalNumberOfConsumers, throughputMessagesPerS FROM VaryingNumberOfParticipants WHERE participantName = 'All' and totalNumberOfProducers = '5' and acknowledgeMode = '1'
+series.2.legend=5 Producers
+series.2.dir=${csvCurrentDir}
+series.2.colourName=green
+
+series.3.statement=SELECT totalNumberOfConsumers, throughputMessagesPerS FROM VaryingNumberOfParticipants WHERE participantName = 'All' and totalNumberOfProducers = '10' and acknowledgeMode = '1'
+series.3.legend=10 Producers
+series.3.dir=${csvCurrentDir}
+series.3.colourName=red
+
+series.4.statement=SELECT totalNumberOfConsumers, throughputMessagesPerS FROM VaryingNumberOfParticipants WHERE participantName = 'All' and totalNumberOfProducers = '10' and acknowledgeMode = '1'
+series.4.legend=10 Producers (baseline)
+series.4.dir=${csvBaselineDir}
+series.4.colourName=dark_red
+series.4.strokeWidth=-1
diff --git a/java/perftests/etc/chartdefs/1012-VaryingNumberOfConsumers.chartdef b/java/perftests/etc/chartdefs/1012-VaryingNumberOfConsumers.chartdef
deleted file mode 100644
index 0f0b35a7c8..0000000000
--- a/java/perftests/etc/chartdefs/1012-VaryingNumberOfConsumers.chartdef
+++ /dev/null
@@ -1,40 +0,0 @@
-#
-# 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=Varying number of consumers
-chartSubtitle=Persistent 1KB messages
-xAxisTitle=Consumers
-yAxisTitle=Throughput (KB/s)
-
-series.1.statement=SELECT totalNumberOfConsumers, throughputKbPerS FROM VaryingNumberOfParticipants WHERE participantName = 'All' and totalNumberOfProducers = '1'
-series.1.legend=1 Producer
-series.1.dir=${csvCurrentDir}
-
-series.2.statement=SELECT totalNumberOfConsumers, throughputKbPerS FROM VaryingNumberOfParticipants WHERE participantName = 'All' and totalNumberOfProducers = '5'
-series.2.legend=5 Producers
-series.2.dir=${csvCurrentDir}
-
-series.3.statement=SELECT totalNumberOfConsumers, throughputKbPerS FROM VaryingNumberOfParticipants WHERE participantName = 'All' and totalNumberOfProducers = '10'
-series.3.legend=10 Producers
-series.3.dir=${csvCurrentDir}
-
-series.4.statement=SELECT totalNumberOfConsumers, throughputKbPerS FROM VaryingNumberOfParticipants WHERE participantName = 'All' and totalNumberOfProducers = '10'
-series.4.legend=10 Producers (baseline)
-series.4.dir=${csvBaselineDir}
diff --git a/java/perftests/etc/chartdefs/1015-VaryingNumberOfProducers-SessionTrans.chartdef b/java/perftests/etc/chartdefs/1015-VaryingNumberOfProducers-SessionTrans.chartdef
new file mode 100644
index 0000000000..42ba6f8f20
--- /dev/null
+++ b/java/perftests/etc/chartdefs/1015-VaryingNumberOfProducers-SessionTrans.chartdef
@@ -0,0 +1,47 @@
+#
+# 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=Varying number of producers - transacted
+chartSubtitle=Persistent 1KB messages
+chartDescription=1,2,5,10 P/Cs, persistent, transacted, with message payload 1KB.
+
+xAxisTitle=Producers
+yAxisTitle=Throughput (messages/s)
+
+series.1.statement=SELECT totalNumberOfProducers, throughputMessagesPerS FROM VaryingNumberOfParticipants WHERE participantName = 'All' and totalNumberOfConsumers = '1' and acknowledgeMode = '0'
+series.1.legend=1 Consumer
+series.1.dir=${csvCurrentDir}
+series.1.colourName=red
+
+series.2.statement=SELECT totalNumberOfProducers, throughputMessagesPerS FROM VaryingNumberOfParticipants WHERE participantName = 'All' and totalNumberOfConsumers = '5' and acknowledgeMode = '0'
+series.2.legend=5 Consumer
+series.2.dir=${csvCurrentDir}
+series.2.colourName=blue
+
+series.3.statement=SELECT totalNumberOfProducers, throughputMessagesPerS FROM VaryingNumberOfParticipants WHERE participantName = 'All' and totalNumberOfConsumers = '10' and acknowledgeMode = '0'
+series.3.legend=10 Consumer
+series.3.dir=${csvCurrentDir}
+series.3.colourName=green
+
+series.4.statement=SELECT totalNumberOfProducers, throughputMessagesPerS FROM VaryingNumberOfParticipants WHERE participantName = 'All' and totalNumberOfConsumers = '1' and acknowledgeMode = '0'
+series.4.legend=1 Consumer (baseline)
+series.4.dir=${csvBaselineDir}
+series.4.colourName=dark_red
+series.4.strokeWidth=-1
diff --git a/java/perftests/etc/chartdefs/1016-VaryingNumberOfConsumers-SessionTrans.chartdef b/java/perftests/etc/chartdefs/1016-VaryingNumberOfConsumers-SessionTrans.chartdef
new file mode 100644
index 0000000000..0afd162ad0
--- /dev/null
+++ b/java/perftests/etc/chartdefs/1016-VaryingNumberOfConsumers-SessionTrans.chartdef
@@ -0,0 +1,47 @@
+#
+# 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=Varying number of consumers - transacted
+chartSubtitle=Persistent 1KB messages
+chartDescription=1,2,5,10 P/Cs, persistent, transacted, with message payload 1KB.
+
+xAxisTitle=Consumers
+yAxisTitle=Throughput (messages/s)
+
+series.1.statement=SELECT totalNumberOfConsumers, throughputMessagesPerS FROM VaryingNumberOfParticipants WHERE participantName = 'All' and totalNumberOfProducers = '1' and acknowledgeMode = '0'
+series.1.legend=1 Producer
+series.1.dir=${csvCurrentDir}
+series.1.colourName=blue
+
+series.2.statement=SELECT totalNumberOfConsumers, throughputMessagesPerS FROM VaryingNumberOfParticipants WHERE participantName = 'All' and totalNumberOfProducers = '5' and acknowledgeMode = '0'
+series.2.legend=5 Producers
+series.2.dir=${csvCurrentDir}
+series.2.colourName=green
+
+series.3.statement=SELECT totalNumberOfConsumers, throughputMessagesPerS FROM VaryingNumberOfParticipants WHERE participantName = 'All' and totalNumberOfProducers = '10' and acknowledgeMode = '0'
+series.3.legend=10 Producers
+series.3.dir=${csvCurrentDir}
+series.3.colourName=red
+
+series.4.statement=SELECT totalNumberOfConsumers, throughputMessagesPerS FROM VaryingNumberOfParticipants WHERE participantName = 'All' and totalNumberOfProducers = '10' and acknowledgeMode = '0'
+series.4.legend=10 Producers (baseline)
+series.4.dir=${csvBaselineDir}
+series.4.colourName=dark_red
+series.4.strokeWidth=-1
diff --git a/java/perftests/etc/chartdefs/1021-AcknowledgementModes-Persistent.chartdef b/java/perftests/etc/chartdefs/1021-AcknowledgementModes-Persistent.chartdef
index 30aee40c27..827f8b5567 100644
--- a/java/perftests/etc/chartdefs/1021-AcknowledgementModes-Persistent.chartdef
+++ b/java/perftests/etc/chartdefs/1021-AcknowledgementModes-Persistent.chartdef
@@ -19,17 +19,20 @@
chartType=BAR
chartTitle=Performance of acknowledgement modes
-chartSubtitle=Persistent messages (1024b)
+chartSubtitle=Persistent messages (1KB)
+chartDescription=1P 1C, persistent, with message payload 1KB.
+
xAxisTitle=Acknowledge mode (0=session transacted; 1=auto-acknowledge)
-yAxisTitle=Throughput (KB/s)
+yAxisTitle=Throughput (messages/s)
-series.1.statement=SELECT acknowledgeMode, throughputKbPerS FROM AcknowledgementModes WHERE testName like 'Persistent%' AND participantName = 'All' ORDER BY acknowledgeMode
+series.1.statement=SELECT acknowledgeMode, throughputMessagesPerS FROM AcknowledgementModes WHERE testName like 'Persistent%' AND participantName = 'All' ORDER BY acknowledgeMode
series.1.legend=Current
series.1.dir=${csvCurrentDir}
+series.1.colourName=blue
-
-series.2.statement=SELECT acknowledgeMode, throughputKbPerS FROM AcknowledgementModes WHERE testName like 'Persistent%' AND participantName = 'All' ORDER BY acknowledgeMode
+series.2.statement=SELECT acknowledgeMode, throughputMessagesPerS FROM AcknowledgementModes WHERE testName like 'Persistent%' AND participantName = 'All' ORDER BY acknowledgeMode
series.2.legend=Baseline
series.2.dir=${csvBaselineDir}
+series.2.colourName=dark_red
diff --git a/java/perftests/etc/chartdefs/1022-AcknowledgementModes-Transient.chartdef b/java/perftests/etc/chartdefs/1022-AcknowledgementModes-Transient.chartdef
index 7a26391deb..8ca5d838e2 100644
--- a/java/perftests/etc/chartdefs/1022-AcknowledgementModes-Transient.chartdef
+++ b/java/perftests/etc/chartdefs/1022-AcknowledgementModes-Transient.chartdef
@@ -20,13 +20,17 @@
chartType=BAR
chartTitle=Performance of acknowledgement modes
chartSubtitle=Transient messages (1024b)
+chartDescription=1P 1C, transient, with message payload 1KB.
+
xAxisTitle=Acknowledge mode (0=session transacted; 1=auto-acknowledge)
-yAxisTitle=Throughput (KB/s)
+yAxisTitle=Throughput (messages/s)
-series.1.statement=SELECT acknowledgeMode, throughputKbPerS FROM AcknowledgementModes WHERE testName like 'Transient%' AND participantName = 'All' ORDER BY acknowledgeMode
+series.1.statement=SELECT acknowledgeMode, throughputMessagesPerS FROM AcknowledgementModes WHERE testName like 'Transient%' AND participantName = 'All' ORDER BY acknowledgeMode
series.1.legend=Current
series.1.dir=${csvCurrentDir}
+series.1.colourName=blue
-series.2.statement=SELECT acknowledgeMode, throughputKbPerS FROM AcknowledgementModes WHERE testName like 'Transient%' AND participantName = 'All' ORDER BY acknowledgeMode
+series.2.statement=SELECT acknowledgeMode, throughputMessagesPerS FROM AcknowledgementModes WHERE testName like 'Transient%' AND participantName = 'All' ORDER BY acknowledgeMode
series.2.legend=Baseline
series.2.dir=${csvBaselineDir}
+series.2.colourName=dark_red
diff --git a/java/perftests/etc/chartdefs/1030-BatchSize-Equal.chartdef b/java/perftests/etc/chartdefs/1030-BatchSize-Equal.chartdef
new file mode 100644
index 0000000000..97b712e027
--- /dev/null
+++ b/java/perftests/etc/chartdefs/1030-BatchSize-Equal.chartdef
@@ -0,0 +1,37 @@
+#
+# 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 Sizes Equal
+chartSubtitle=Persistent 1KB 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=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=Equal Producer/Consumer (Baseline)
+series.2.dir=${csvBaselineDir}
+series.2.colourName=dark_red
+series.2.strokeWidth=-1
diff --git a/java/perftests/etc/chartdefs/1030-BatchSize.chartdef b/java/perftests/etc/chartdefs/1030-BatchSize.chartdef
deleted file mode 100644
index 1f01aa85aa..0000000000
--- a/java/perftests/etc/chartdefs/1030-BatchSize.chartdef
+++ /dev/null
@@ -1,33 +0,0 @@
-#
-# 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
-chartSubtitle=Persistent 1KB messages
-xAxisTitle=Batch Size
-yAxisTitle=Throughput (KB/s)
-
-series.1.statement=SELECT batchSize, throughputKbPerS FROM BatchSize WHERE participantName = 'All'
-series.1.legend=Current
-series.1.dir=${csvCurrentDir}
-
-series.2.statement=SELECT batchSize, throughputKbPerS FROM BatchSize WHERE participantName = 'All'
-series.2.legend=Baseline
-series.2.dir=${csvBaselineDir}
-
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/chartdefs/1040-QueueTypes.chartdef b/java/perftests/etc/chartdefs/1040-QueueTypes.chartdef
index 42ed69c19d..aacedab421 100644
--- a/java/perftests/etc/chartdefs/1040-QueueTypes.chartdef
+++ b/java/perftests/etc/chartdefs/1040-QueueTypes.chartdef
@@ -20,13 +20,17 @@
chartType=BAR
chartTitle=Queue Types
chartSubtitle=Persistent 1KB messages
+chartDescription=1P 1C, persistent, auto-ack with message payload 1KB. Sorted queue - 160,000 random keys, Priority - iteriates priority 0..9.
+
xAxisTitle=Queue Types
-yAxisTitle=Throughput (KB/s)
+yAxisTitle=Throughput (messages/s)
-series.1.statement=SELECT testName, throughputKbPerS FROM QueueTypes WHERE participantName = 'All'
+series.1.statement=SELECT testName, throughputMessagesPerS FROM QueueTypes WHERE participantName = 'All'
series.1.legend=Current
series.1.dir=${csvCurrentDir}
+series.1.colourName=blue
-series.2.statement=SELECT testName, throughputKbPerS FROM QueueTypes WHERE participantName = 'All'
+series.2.statement=SELECT testName, throughputMessagesPerS FROM QueueTypes WHERE participantName = 'All'
series.2.legend=Baseline
series.2.dir=${csvBaselineDir}
+series.2.colourName=dark_red
diff --git a/java/perftests/etc/chartdefs/1050-VaryingNumberOfProducerSessionsSingleConnection.chartdef b/java/perftests/etc/chartdefs/1050-VaryingNumberOfProducerSessionsSingleConnection.chartdef
new file mode 100644
index 0000000000..46696bf942
--- /dev/null
+++ b/java/perftests/etc/chartdefs/1050-VaryingNumberOfProducerSessionsSingleConnection.chartdef
@@ -0,0 +1,49 @@
+#
+# 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=Varying number of producer sessions on single connection
+chartSubtitle=Persistent messages (1024b)
+chartDescription=1-80P transacted on single connection, 20C transacted on separate connections, persistent, message payload 1KB.
+
+xAxisTitle=Number of producer sessions
+yAxisTitle=Throughput (KB/s)
+
+# testName contains the number of sessions
+series.1.statement=SELECT testName, throughputKbPerS FROM VaryingNumberOfProducerSessionsSingleConnection WHERE participantName = 'All'
+series.1.legend=Current - End-to-end throughput
+series.1.dir=${csvCurrentDir}
+series.1.colourName=red
+
+series.2.statement=SELECT testName, throughputKbPerS FROM VaryingNumberOfProducerSessionsSingleConnection WHERE participantName = 'All Producers'
+series.2.legend=Current - Producer only throughput
+series.2.dir=${csvCurrentDir}
+series.2.colourName=blue
+
+series.3.statement=SELECT testName, throughputKbPerS FROM VaryingNumberOfProducerSessionsSingleConnection WHERE participantName = 'All'
+series.3.legend=Baseline - End-to-end throughput
+series.3.dir=${csvBaselineDir}
+series.3.colourName=dark_red
+series.3.strokeWidth=-1
+
+series.4.statement=SELECT testName, throughputKbPerS FROM VaryingNumberOfProducerSessionsSingleConnection WHERE participantName = 'All Producers'
+series.4.legend=Baseline - Producer only throughput
+series.4.dir=${csvBaselineDir}
+series.4.colourName=dark_blue
+series.4.strokeWidth=-1
diff --git a/java/perftests/etc/chartdefs/1300-QueueConsumersWithNonOverlappingSelectors-Transient.chartdef b/java/perftests/etc/chartdefs/1300-QueueConsumersWithNonOverlappingSelectors-Transient.chartdef
new file mode 100644
index 0000000000..5081b379e7
--- /dev/null
+++ b/java/perftests/etc/chartdefs/1300-QueueConsumersWithNonOverlappingSelectors-Transient.chartdef
@@ -0,0 +1,37 @@
+#
+# 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=Impact of non-overlapping selectors on queue consumers with transient messages
+chartSubtitle=Transient 1KB messages
+xAxisTitle=Consumers
+yAxisTitle=Throughput (messages/s)
+chartDescription=Impact of non-overlapping selectors on queue consumers with transient messages, auto-ack, message payload of 1024 bytes, 1 producer, varying number of consumers from 1 to 32.
+
+series.1.statement=SELECT totalNumberOfConsumers, throughputMessagesPerS FROM QueueConsumersWithNonOverlappingSelectors WHERE participantName = 'All' and testName like '%non overlapping - NON_PERSISTENT%'
+series.1.legend=Current
+series.1.dir=${csvCurrentDir}
+series.1.colourName=blue
+
+series.2.statement=SELECT totalNumberOfConsumers, throughputMessagesPerS FROM QueueConsumersWithNonOverlappingSelectors WHERE participantName = 'All' and testName like '%non overlapping - NON_PERSISTENT%'
+series.2.legend=Baseline
+series.2.dir=${csvBaselineDir}
+series.2.colourName=dark_red
+series.2.stokeWidth=-1
+
diff --git a/java/perftests/etc/chartdefs/1301-QueueConsumersWithNonOverlappingSelectors-Persistent.chartdef b/java/perftests/etc/chartdefs/1301-QueueConsumersWithNonOverlappingSelectors-Persistent.chartdef
new file mode 100644
index 0000000000..137f7bde36
--- /dev/null
+++ b/java/perftests/etc/chartdefs/1301-QueueConsumersWithNonOverlappingSelectors-Persistent.chartdef
@@ -0,0 +1,43 @@
+#
+# 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=Impact of non-overlapping selectors on queue consumers with persistent messages
+chartSubtitle=Persistent 1KB messages
+xAxisTitle=Consumers
+yAxisTitle=Throughput (messages/s)
+chartDescription=Impact of non-overlapping selectors on queue consumers with persistent messages, auto-ack, message payload of 1024 bytes, 1 producer, varying number of consumers from 1 to 32..
+
+
+series.1.statement=SELECT totalNumberOfConsumers, throughputMessagesPerS FROM QueueConsumersWithNonOverlappingSelectors WHERE participantName = 'All' and testName like '%non overlapping - PERSISTENT'
+series.1.legend=Current
+series.1.dir=${csvCurrentDir}
+series.1.colourName=blue
+
+series.2.statement=SELECT totalNumberOfConsumers, throughputMessagesPerS FROM QueueConsumersWithNonOverlappingSelectors WHERE participantName = 'All' and testName like '%non overlapping - PERSISTENT'
+series.2.legend=Baseline
+series.2.dir=${csvBaselineDir}
+series.2.colourName=dark_red
+series.2.stokeWidth=-1
+
+series.3.statement=SELECT totalNumberOfConsumers, throughputMessagesPerS FROM VaryingNumberOfParticipants WHERE participantName = 'All' and totalNumberOfProducers = '1' and acknowledgeMode = '1'
+series.3.legend=Current: no selectors
+series.3.dir=${csvCurrentDir}
+series.3.colourName=green
+
diff --git a/java/perftests/etc/chartdefs/1302-QueueConsumersWithOverlappingSelectors-Transient.chartdef b/java/perftests/etc/chartdefs/1302-QueueConsumersWithOverlappingSelectors-Transient.chartdef
new file mode 100644
index 0000000000..74f370317b
--- /dev/null
+++ b/java/perftests/etc/chartdefs/1302-QueueConsumersWithOverlappingSelectors-Transient.chartdef
@@ -0,0 +1,36 @@
+#
+# 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=Impact of 50%-overlapping selectors in queue consumers with transient messages
+chartSubtitle=Transient 1KB messages
+xAxisTitle=Consumers
+yAxisTitle=Throughput (messages/s)
+chartDescription=Impact of 50%-overlapping selectors in queue consumers with transient messages, auto-ack, message payload 1KB, 1 producer, varying number of consumers from 2 to 32.
+
+series.1.statement=SELECT totalNumberOfConsumers,throughputMessagesPerS FROM QueueConsumersWithOverlappingSelectors WHERE participantName = 'All' and testName like '%50_ overlapping - NON_PERSISTENT%'
+series.1.legend=Current
+series.1.dir=${csvCurrentDir}
+series.1.colourName=blue
+
+series.2.statement=SELECT totalNumberOfConsumers, throughputMessagesPerS FROM QueueConsumersWithOverlappingSelectors WHERE participantName = 'All' and testName like '%50_ overlapping - NON_PERSISTENT%'
+series.2.legend=Baseline
+series.2.dir=${csvBaselineDir}
+series.2.colourName=dark_red
+series.2.stokeWidth=-1
diff --git a/java/perftests/etc/chartdefs/1303-QueueConsumersWithOverlappingSelectors-Persistent.chartdef b/java/perftests/etc/chartdefs/1303-QueueConsumersWithOverlappingSelectors-Persistent.chartdef
new file mode 100644
index 0000000000..0dd78e02ef
--- /dev/null
+++ b/java/perftests/etc/chartdefs/1303-QueueConsumersWithOverlappingSelectors-Persistent.chartdef
@@ -0,0 +1,42 @@
+#
+# 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=Impact of 50%-overlapping selectors in queue consumers with persistent messages
+chartDescription=Impact of 50%-overlapping selectors in queue consumers with persistent messages, auto-ack, message payload of 1KB, 1 producer, varying number of consumers from 2 to 32.
+chartSubtitle=Persistent 1KB messages
+xAxisTitle=Consumers
+yAxisTitle=Throughput (messages/s)
+
+series.1.statement=SELECT totalNumberOfConsumers, throughputMessagesPerS FROM QueueConsumersWithOverlappingSelectors WHERE participantName = 'All' and testName like '%50_ overlapping - PERSISTENT%'
+series.1.legend=Current
+series.1.dir=${csvCurrentDir}
+series.1.colourName=blue
+
+series.2.statement=SELECT totalNumberOfConsumers, throughputMessagesPerS FROM QueueConsumersWithOverlappingSelectors WHERE participantName = 'All' and testName like '%50_ overlapping - PERSISTENT%'
+series.2.legend=Baseline
+series.2.dir=${csvBaselineDir}
+series.2.colourName=dark_red
+series.2.stokeWidth=-1
+
+series.3.statement=SELECT totalNumberOfConsumers, throughputMessagesPerS FROM VaryingNumberOfParticipants WHERE participantName = 'All' and totalNumberOfProducers = '1' and acknowledgeMode = '1'
+series.3.legend=Current: no selectors
+series.3.dir=${csvCurrentDir}
+series.3.colourName=green
+
diff --git a/java/perftests/etc/chartdefs/1500-Topic-NumberOfConsumers.chartdef b/java/perftests/etc/chartdefs/1500-Topic-NumberOfConsumers.chartdef
index 305c5009e2..073cee810d 100644
--- a/java/perftests/etc/chartdefs/1500-Topic-NumberOfConsumers.chartdef
+++ b/java/perftests/etc/chartdefs/1500-Topic-NumberOfConsumers.chartdef
@@ -20,13 +20,18 @@
chartType=XYLINE
chartTitle=Number of topic consumers
chartSubtitle=Transient 1KB messages
+chartDescription=1P 1-100C transient, transacted, with message payload 1KB.
+
xAxisTitle=Numer of consumers
-yAxisTitle=Throughput (KB/s)
+yAxisTitle=Throughput (messages/s)
-series.1.statement=SELECT testName, throughputKbPerS FROM Topic-NumberOfConsumers WHERE participantName = 'All'
+series.1.statement=SELECT totalNumberOfConsumers, throughputMessagesPerS FROM Topic-NumberOfConsumers WHERE participantName = 'All'
series.1.legend=Current
series.1.dir=${csvCurrentDir}
+series.1.colourName=red
-series.2.statement=SELECT testName, throughputKbPerS FROM Topic-NumberOfConsumers WHERE participantName = 'All'
+series.2.statement=SELECT totalNumberOfConsumers, throughputMessagesPerS FROM Topic-NumberOfConsumers WHERE participantName = 'All'
series.2.legend=Baseline
series.2.dir=${csvBaselineDir}
+series.2.colourName=dark_red
+series.2.strokeWidth=-1
diff --git a/java/perftests/etc/chartdefs/1501-Topic-NumberOfTopics.chartdef b/java/perftests/etc/chartdefs/1501-Topic-NumberOfTopics.chartdef
index 9bc53e5a9e..b32f43d0c2 100644
--- a/java/perftests/etc/chartdefs/1501-Topic-NumberOfTopics.chartdef
+++ b/java/perftests/etc/chartdefs/1501-Topic-NumberOfTopics.chartdef
@@ -20,13 +20,18 @@
chartType=XYLINE
chartTitle=Number of topics
chartSubtitle=Transient 1KB messages
+chartDescription=1,10,50,100 PC, transient, transacted, with each PC pair having own topic, message payload 1KB.
+
xAxisTitle=Numer of topics
-yAxisTitle=Throughput (KB/s)
+yAxisTitle=Throughput (messages/s)
-series.1.statement=SELECT testName, throughputKbPerS FROM Topic-NumberOfTopics WHERE participantName = 'All'
+series.1.statement=SELECT totalNumberOfProducers, throughputMessagesPerS FROM Topic-NumberOfTopics WHERE participantName = 'All'
series.1.legend=Current
series.1.dir=${csvCurrentDir}
+series.1.colourName=red
-series.2.statement=SELECT testName, throughputKbPerS FROM Topic-NumberOfTopics WHERE participantName = 'All'
+series.2.statement=SELECT totalNumberOfProducers, throughputMessagesPerS FROM Topic-NumberOfTopics WHERE participantName = 'All'
series.2.legend=Baseline
series.2.dir=${csvBaselineDir}
+series.2.colourName=dark_red
+series.2.strokeWidth=-1
diff --git a/java/perftests/etc/chartdefs/1502-Topic-Persistence.chartdef b/java/perftests/etc/chartdefs/1502-Topic-Persistence.chartdef
index ce64d14ac4..5fd905ab4f 100644
--- a/java/perftests/etc/chartdefs/1502-Topic-Persistence.chartdef
+++ b/java/perftests/etc/chartdefs/1502-Topic-Persistence.chartdef
@@ -20,13 +20,18 @@
chartType=BAR
chartTitle=Topic transient/durable subscriptions
chartSubtitle=1KB messages
-xAxisTitle=Durable subscription
-yAxisTitle=Throughput (KB/s)
+chartDescription=1P 10C, transacted, message payload 1KB, transient messages on non-durable sub, persistent messages on durable sub
-series.1.statement=SELECT isDurableSubscription, throughputKbPerS FROM Topic-Persistence WHERE participantName = 'All Consumers'
+xAxisTitle=Subscription type (true durable, false non durable)
+yAxisTitle=Throughput (messages/s)
+
+series.1.statement=SELECT isDurableSubscription, throughputMessagesPerS FROM Topic-Persistence WHERE participantName = 'All Consumers'
series.1.legend=Current
series.1.dir=${csvCurrentDir}
+series.1.colourName=blue
-series.2.statement=SELECT isDurableSubscription, throughputKbPerS FROM Topic-Persistence WHERE participantName = 'All Consumers'
+series.2.statement=SELECT isDurableSubscription, throughputMessagesPerS FROM Topic-Persistence WHERE participantName = 'All Consumers'
series.2.legend=Baseline
series.2.dir=${csvBaselineDir}
+series.2.colourName=dark_red
+series.2.stokeWidth=2
diff --git a/java/perftests/etc/chartdefs/1503-Topic-AckModes.chartdef b/java/perftests/etc/chartdefs/1503-Topic-AckModes.chartdef
index 5ccc166fc8..9edb1950a4 100644
--- a/java/perftests/etc/chartdefs/1503-Topic-AckModes.chartdef
+++ b/java/perftests/etc/chartdefs/1503-Topic-AckModes.chartdef
@@ -20,13 +20,18 @@
chartType=BAR
chartTitle=Topic acknowledge modes
chartSubtitle=Transient 1KB messages
-xAxisTitle=Ack Mode
-yAxisTitle=Throughput (KB/s)
+chartDescription=1P 10C, transient, non-durable subscription, message payload 1KB
-series.1.statement=SELECT acknowledgeMode, throughputKbPerS FROM Topic-AckModes WHERE participantName = 'All'
+xAxisTitle=Ack Mode (0=transaction 1=auto-ack)
+yAxisTitle=Throughput (messages/s)
+
+series.1.statement=SELECT acknowledgeMode, throughputMessagesPerS FROM Topic-AckModes WHERE participantName = 'All'
series.1.legend=Current
series.1.dir=${csvCurrentDir}
+series.1.colourName=blue
-series.2.statement=SELECT acknowledgeMode, throughputKbPerS FROM Topic-AckModes WHERE participantName = 'All'
+series.2.statement=SELECT acknowledgeMode, throughputMessagesPerS FROM Topic-AckModes WHERE participantName = 'All'
series.2.legend=Baseline
series.2.dir=${csvBaselineDir}
+series.2.colourName=dark_red
+series.2.stokeWidth=2
diff --git a/java/perftests/etc/chartdefs/2001-Latency-MessageSize-Transient.chartdef b/java/perftests/etc/chartdefs/2001-Latency-MessageSize-Transient.chartdef
index c892ea16cf..67a0278bff 100644
--- a/java/perftests/etc/chartdefs/2001-Latency-MessageSize-Transient.chartdef
+++ b/java/perftests/etc/chartdefs/2001-Latency-MessageSize-Transient.chartdef
@@ -20,21 +20,27 @@
chartType=STATISTICAL_BAR
chartTitle=Impact of message size on latency
chartSubtitle=Transient messages
+chartDescription=1P 1C, transient, auto-ack, with message payload between 256-262144 bytes.
+
xAxisTitle=Message Size (B)
yAxisTitle=Latency (millis)
series.1.statement=SELECT payloadSizeB, maxLatency, 0 FROM Latency-MessageSize WHERE testName like '%TRANSIENT' AND participantName = 'All Consumers'
series.1.legend=Maximum latency
series.1.dir=${csvCurrentDir}
+series.1.colourName=blue
series.2.statement=SELECT payloadSizeB, averageLatency,latencyStandardDeviation FROM Latency-MessageSize WHERE testName like '%TRANSIENT' AND participantName = 'All Consumers'
series.2.legend=Average latency
series.2.dir=${csvCurrentDir}
+series.2.colourName=red
series.3.statement=SELECT payloadSizeB, averageLatency,latencyStandardDeviation FROM Latency-MessageSize WHERE testName like '%TRANSIENT' AND participantName = 'All Consumers'
series.3.legend=Average latency (baseline)
series.3.dir=${csvBaselineDir}
+series.3.colourName=dark_red
series.4.statement=SELECT payloadSizeB, minLatency,0 FROM Latency-MessageSize WHERE testName like '%TRANSIENT' AND participantName = 'All Consumers'
series.4.legend=Minimum latency
series.4.dir=${csvCurrentDir}
+series.4.colourName=green
diff --git a/java/perftests/etc/chartdefs/2002-Latency-MessageSize-Persistent.chartdef b/java/perftests/etc/chartdefs/2002-Latency-MessageSize-Persistent.chartdef
index 167e62603a..e9761f07d8 100644
--- a/java/perftests/etc/chartdefs/2002-Latency-MessageSize-Persistent.chartdef
+++ b/java/perftests/etc/chartdefs/2002-Latency-MessageSize-Persistent.chartdef
@@ -20,21 +20,27 @@
chartType=STATISTICAL_BAR
chartTitle=Impact of message size on latency
chartSubtitle=Persistent messages
+chartDescription=1P 1C, persistent, auto-ack, with message payload between 256-262144 bytes.
+
xAxisTitle=Message Size (B)
yAxisTitle=Latency (millis)
series.1.statement=SELECT payloadSizeB, maxLatency, 0 FROM Latency-MessageSize WHERE testName like '%PERSISTENT' AND participantName = 'All Consumers'
series.1.legend=Maximum latency
series.1.dir=${csvCurrentDir}
+series.1.colourName=blue
series.2.statement=SELECT payloadSizeB, averageLatency, latencyStandardDeviation FROM Latency-MessageSize WHERE testName like '%PERSISTENT' AND participantName = 'All Consumers'
series.2.legend=Average latency
series.2.dir=${csvCurrentDir}
+series.2.colourName=red
series.3.statement=SELECT payloadSizeB, averageLatency, latencyStandardDeviation FROM Latency-MessageSize WHERE testName like '%PERSISTENT' AND participantName = 'All Consumers'
series.3.legend=Average latency (baseline)
series.3.dir=${csvBaselineDir}
+series.3.colourName=dark_red
series.4.statement=SELECT payloadSizeB, minLatency, 0 FROM Latency-MessageSize WHERE testName like '%PERSISTENT' AND participantName = 'All Consumers'
series.4.legend=Minimum latency
series.4.dir=${csvCurrentDir}
+series.4.colourName=green
diff --git a/java/perftests/etc/chartdefs/2011-Latency-QueuesWithNonOverlappingSelectors-Transient.chartdef b/java/perftests/etc/chartdefs/2011-Latency-QueuesWithNonOverlappingSelectors-Transient.chartdef
index 45c6031b1e..663912b622 100644
--- a/java/perftests/etc/chartdefs/2011-Latency-QueuesWithNonOverlappingSelectors-Transient.chartdef
+++ b/java/perftests/etc/chartdefs/2011-Latency-QueuesWithNonOverlappingSelectors-Transient.chartdef
@@ -20,21 +20,27 @@
chartType=STATISTICAL_BAR
chartTitle=Latency with consumers having non-overlapping selectors
chartSubtitle=Transient 1KB messages
+chartDescription=1P 1-10C, transient, auto-ack, with message payload 1KB.
+
xAxisTitle=Consumers
yAxisTitle=Latency (millis)
series.1.statement=SELECT totalNumberOfConsumers, maxLatency, 0 FROM Latency-QueuesWithSelectors WHERE participantName = 'All Consumers' and testName like '%non overlapping - NON_PERSISTENT%'
series.1.legend=Max latency
series.1.dir=${csvCurrentDir}
+series.1.colourName=blue
series.2.statement=SELECT totalNumberOfConsumers, averageLatency,latencyStandardDeviation FROM Latency-QueuesWithSelectors WHERE participantName = 'All Consumers' and testName like '%non overlapping - NON_PERSISTENT%'
series.2.legend=Average latency
series.2.dir=${csvCurrentDir}
+series.2.colourName=red
series.3.statement=SELECT totalNumberOfConsumers, averageLatency,latencyStandardDeviation FROM Latency-QueuesWithSelectors WHERE participantName = 'All Consumers' and testName like '%non overlapping - NON_PERSISTENT%'
series.3.legend=Average latency (baseline)
series.3.dir=${csvBaselineDir}
+series.3.colourName=dark_red
series.4.statement=SELECT totalNumberOfConsumers, minLatency, 0 FROM Latency-QueuesWithSelectors WHERE participantName = 'All Consumers' and testName like '%non overlapping - NON_PERSISTENT%'
series.4.legend=Min latency
series.4.dir=${csvCurrentDir}
+series.4.colourName=green
diff --git a/java/perftests/etc/chartdefs/2012-Latency-QueuesWithOverlappingSelectors-Transient.chartdef b/java/perftests/etc/chartdefs/2012-Latency-QueuesWithOverlappingSelectors-Transient.chartdef
index 351a4639b1..3b9e207e10 100644
--- a/java/perftests/etc/chartdefs/2012-Latency-QueuesWithOverlappingSelectors-Transient.chartdef
+++ b/java/perftests/etc/chartdefs/2012-Latency-QueuesWithOverlappingSelectors-Transient.chartdef
@@ -20,21 +20,27 @@
chartType=STATISTICAL_BAR
chartTitle=Latency with consumers having 50%-overlapping selectors
chartSubtitle=Transient 1KB messages
+chartDescription=1P 1-10C, transient, auto-ack, with message payload 1KB.
+
xAxisTitle=Consumers
yAxisTitle=Latency (millis)
series.1.statement=SELECT totalNumberOfConsumers, maxLatency, 0 FROM Latency-QueuesWithSelectors WHERE participantName = 'All Consumers' and testName like '%overlapping 50% - NON_PERSISTENT%'
series.1.legend=Max latency
series.1.dir=${csvCurrentDir}
+series.1.colourName=blue
series.2.statement=SELECT totalNumberOfConsumers, averageLatency,latencyStandardDeviation FROM Latency-QueuesWithSelectors WHERE participantName = 'All Consumers' and testName like '%overlapping 50% - NON_PERSISTENT%'
series.2.legend=Average latency
series.2.dir=${csvCurrentDir}
+series.2.colourName=red
series.3.statement=SELECT totalNumberOfConsumers, averageLatency,latencyStandardDeviation FROM Latency-QueuesWithSelectors WHERE participantName = 'All Consumers' and testName like '%overlapping 50% - NON_PERSISTENT%'
series.3.legend=Average latency (baseline)
series.3.dir=${csvBaselineDir}
+series.3.colourName=dark_red
series.4.statement=SELECT totalNumberOfConsumers, minLatency, 0 FROM Latency-QueuesWithSelectors WHERE participantName = 'All Consumers' and testName like '%overlapping 50% - NON_PERSISTENT%'
series.4.legend=Min latency
series.4.dir=${csvCurrentDir}
+series.4.colourName=green
diff --git a/java/perftests/etc/chartdefs/2021-Latency-QueuesWithNonOverlappingSelectors-Persistent.chartdef b/java/perftests/etc/chartdefs/2021-Latency-QueuesWithNonOverlappingSelectors-Persistent.chartdef
index 9d95075b3d..296d115d3f 100644
--- a/java/perftests/etc/chartdefs/2021-Latency-QueuesWithNonOverlappingSelectors-Persistent.chartdef
+++ b/java/perftests/etc/chartdefs/2021-Latency-QueuesWithNonOverlappingSelectors-Persistent.chartdef
@@ -20,21 +20,27 @@
chartType=STATISTICAL_BAR
chartTitle=Latency with consumers having non-overlapping selectors
chartSubtitle=Persistent 1KB messages
+chartDescription=1P 1-10C, persistent, auto-ack, with message payload 1KB.
+
xAxisTitle=Consumers
yAxisTitle=Latency (millis)
series.1.statement=SELECT totalNumberOfConsumers, maxLatency,0 FROM Latency-QueuesWithSelectors WHERE participantName = 'All Consumers' and testName like '%non overlapping - PERSISTENT'
series.1.legend=Max latency
series.1.dir=${csvCurrentDir}
+series.1.colourName=blue
series.2.statement=SELECT totalNumberOfConsumers, averageLatency, latencyStandardDeviation FROM Latency-QueuesWithSelectors WHERE participantName = 'All Consumers' and testName like '%non overlapping - PERSISTENT'
series.2.legend=Average latency
series.2.dir=${csvCurrentDir}
+series.2.colourName=red
series.3.statement=SELECT totalNumberOfConsumers, averageLatency, latencyStandardDeviation FROM Latency-QueuesWithSelectors WHERE participantName = 'All Consumers' and testName like '%non overlapping - PERSISTENT'
series.3.legend=Average latency (baseline)
series.3.dir=${csvBaselineDir}
+series.3.colourName=dark_red
series.4.statement=SELECT totalNumberOfConsumers, minLatency, 0 FROM Latency-QueuesWithSelectors WHERE participantName = 'All Consumers' and testName like '%non overlapping - PERSISTENT'
series.4.legend=Min latency
series.4.dir=${csvCurrentDir}
+series.4.colourName=green
diff --git a/java/perftests/etc/chartdefs/2022-Latency-QueuesWithOverlappingSelectors-Persistent.chartdef b/java/perftests/etc/chartdefs/2022-Latency-QueuesWithOverlappingSelectors-Persistent.chartdef
index 9a323d4044..65be60b5e5 100644
--- a/java/perftests/etc/chartdefs/2022-Latency-QueuesWithOverlappingSelectors-Persistent.chartdef
+++ b/java/perftests/etc/chartdefs/2022-Latency-QueuesWithOverlappingSelectors-Persistent.chartdef
@@ -20,21 +20,27 @@
chartType=STATISTICAL_BAR
chartTitle=Latency with consumers having 50%-overlapping selectors
chartSubtitle=Persistent 1KB messages
+chartDescription=1P 1-10C, persistent, auto-ack, with message payload 1KB.
+
xAxisTitle=Consumers
yAxisTitle=Latency (millis)
series.1.statement=SELECT totalNumberOfConsumers, maxLatency, 0 FROM Latency-QueuesWithSelectors WHERE participantName = 'All Consumers' and testName like '%overlapping 50% - PERSISTENT%'
series.1.legend=Max latency
series.1.dir=${csvCurrentDir}
+series.1.colourName=blue
series.2.statement=SELECT totalNumberOfConsumers, averageLatency,latencyStandardDeviation FROM Latency-QueuesWithSelectors WHERE participantName = 'All Consumers' and testName like '%overlapping 50% - PERSISTENT%'
series.2.legend=Average latency
series.2.dir=${csvCurrentDir}
+series.2.colourName=red
series.3.statement=SELECT totalNumberOfConsumers, averageLatency,latencyStandardDeviation FROM Latency-QueuesWithSelectors WHERE participantName = 'All Consumers' and testName like '%overlapping 50% - PERSISTENT%'
series.3.legend=Average latency (baseline)
series.3.dir=${csvBaselineDir}
+series.3.colourName=dark_red
series.4.statement=SELECT totalNumberOfConsumers, minLatency, 0 FROM Latency-QueuesWithSelectors WHERE participantName = 'All Consumers' and testName like '%overlapping 50% - PERSISTENT%'
series.4.legend=Min latency
series.4.dir=${csvCurrentDir}
+series.4.colourName=green
diff --git a/java/perftests/etc/chartdefs/2031-Latency-VaryingNumberOfParticipants.chartdef b/java/perftests/etc/chartdefs/2031-Latency-VaryingNumberOfParticipants.chartdef
index 82cf1168ef..d52b05d870 100644
--- a/java/perftests/etc/chartdefs/2031-Latency-VaryingNumberOfParticipants.chartdef
+++ b/java/perftests/etc/chartdefs/2031-Latency-VaryingNumberOfParticipants.chartdef
@@ -20,25 +20,32 @@
chartType=STATISTICAL_BAR
chartTitle=Latency, varying number of participants
chartSubtitle=Persistent 1KB messages
+chartDescription=1,2,5,10 P/Cs, persistent, auto-ack, with message payload 1KB.
+
xAxisTitle=Consumers
yAxisTitle=Latency (millis)
series.1.statement=SELECT totalNumberOfConsumers, averageLatency,latencyStandardDeviation FROM Latency-VaryingNumberOfParticipants WHERE participantName = 'All Consumers' and testName like '% - 1 producer - PERSISTENT'
series.1.legend=1 producer
series.1.dir=${csvCurrentDir}
+series.1.colourName=blue
series.2.statement=SELECT totalNumberOfConsumers, averageLatency,latencyStandardDeviation FROM Latency-VaryingNumberOfParticipants WHERE participantName = 'All Consumers' and testName like '% - 2 producers - PERSISTENT'
series.2.legend=2 producers
series.2.dir=${csvCurrentDir}
+series.2.colourName=green
series.3.statement=SELECT totalNumberOfConsumers, averageLatency,latencyStandardDeviation FROM Latency-VaryingNumberOfParticipants WHERE participantName = 'All Consumers' and testName like '% - 5 producers - PERSISTENT'
series.3.legend=5 producers
series.3.dir=${csvCurrentDir}
+series.3.colourName=magenta
series.4.statement=SELECT totalNumberOfConsumers, averageLatency,latencyStandardDeviation FROM Latency-VaryingNumberOfParticipants WHERE participantName = 'All Consumers' and testName like '% - 10 producers - PERSISTENT'
series.4.legend=10 producers
series.4.dir=${csvCurrentDir}
+series.4.colourName=red
series.5.statement=SELECT totalNumberOfConsumers, averageLatency,latencyStandardDeviation FROM Latency-VaryingNumberOfParticipants WHERE participantName = 'All Consumers' and testName like '% - 10 producers - PERSISTENT'
series.5.legend=10 producers (baseline)
series.5.dir=${csvBaselineDir}
+series.5.colourName=dark_red
diff --git a/java/perftests/etc/chartdefs/2041-Latency-QueueTypes.chartdef b/java/perftests/etc/chartdefs/2041-Latency-QueueTypes.chartdef
index c1aae19376..dac8a52f89 100644
--- a/java/perftests/etc/chartdefs/2041-Latency-QueueTypes.chartdef
+++ b/java/perftests/etc/chartdefs/2041-Latency-QueueTypes.chartdef
@@ -20,21 +20,27 @@
chartType=STATISTICAL_BAR
chartTitle=Latency on different queues
chartSubtitle=Persistent 1KB messages
+chartDescription=1P 1C, persistent, auto-ack with message payload 1KB. Sorted queue - 400 varied keys, Priority - 200 varied priorities.
+
xAxisTitle=Queue type
yAxisTitle=Latency (millis)
series.1.statement=SELECT testName, maxLatency,0 FROM Latency-QueueTypes WHERE participantName = 'All Consumers'
series.1.legend=Maximum latency
series.1.dir=${csvCurrentDir}
+series.1.colourName=blue
series.2.statement=SELECT testName, averageLatency,latencyStandardDeviation FROM Latency-QueueTypes WHERE participantName = 'All Consumers'
series.2.legend=Average Latency
series.2.dir=${csvCurrentDir}
+series.2.colourName=red
series.3.statement=SELECT testName, averageLatency,latencyStandardDeviation FROM Latency-QueueTypes WHERE participantName = 'All Consumers'
series.3.legend=Average Latency (baseline)
series.3.dir=${csvBaselineDir}
+series.3.colourName=dark_red
series.4.statement=SELECT testName, minLatency,0 FROM Latency-QueueTypes WHERE participantName = 'All Consumers'
series.4.legend=Minimum latency
series.4.dir=${csvCurrentDir}
+series.4.colourName=green
diff --git a/java/perftests/etc/chartdefs/timeseries/1001-Large-Messages-Transient.chartdef b/java/perftests/etc/chartdefs/timeseries/1001-Large-Messages-Transient.chartdef
new file mode 100644
index 0000000000..e77f7b4eff
--- /dev/null
+++ b/java/perftests/etc/chartdefs/timeseries/1001-Large-Messages-Transient.chartdef
@@ -0,0 +1,29 @@
+#
+# 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=TIMELINE
+chartTitle=Large transient messages
+chartDescription=1P 1C, transient, auto-ack, with message payload 65536 bytes.
+
+xAxisTitle=Date
+yAxisTitle=Throughput (KB/s)
+
+series.1.statement=SELECT insertedTimestamp, throughputKbPerS FROM RESULTS WHERE participantName = 'All' AND testName = 'Message Size - 1P-1C - TRANSIENT' and payloadSizeB = 65536
+series.1.colourName=red
+series.1.legend=Throughput
diff --git a/java/perftests/etc/chartdefs/timeseries/1002-Large-Messages-Persistent.chartdef b/java/perftests/etc/chartdefs/timeseries/1002-Large-Messages-Persistent.chartdef
new file mode 100644
index 0000000000..ffcf8c26b8
--- /dev/null
+++ b/java/perftests/etc/chartdefs/timeseries/1002-Large-Messages-Persistent.chartdef
@@ -0,0 +1,29 @@
+#
+# 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=TIMELINE
+chartTitle=Large persistent messages
+chartDescription=1P 1C, persistent, auto-ack, with message payload 65536 bytes.
+
+xAxisTitle=Date
+yAxisTitle=Throughput (KB/s)
+
+series.1.statement=SELECT insertedTimestamp, throughputKbPerS FROM RESULTS WHERE participantName = 'All' AND testName = 'Message Size - 1P-1C - PERSISTENT' and payloadSizeB = 65536
+series.1.colourName=red
+series.1.legend=Throughput
diff --git a/java/perftests/etc/chartdefs/timeseries/1011-MultipleProducersAndConsumers-Persistent.chartdef b/java/perftests/etc/chartdefs/timeseries/1011-MultipleProducersAndConsumers-Persistent.chartdef
new file mode 100644
index 0000000000..ba01d4b7ad
--- /dev/null
+++ b/java/perftests/etc/chartdefs/timeseries/1011-MultipleProducersAndConsumers-Persistent.chartdef
@@ -0,0 +1,30 @@
+#
+# 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=TIMELINE
+chartTitle=Multiple producers and consumers - auto ack
+chartSubtitle=Persistent 1KB messages
+chartDescription=10 P/Cs, persistent, auto-ack, with message payload 1KB.
+
+xAxisTitle=Date
+yAxisTitle=Throughput (KB/s)
+
+series.1.statement=SELECT insertedTimestamp, throughputKbPerS FROM RESULTS WHERE participantName = 'All' AND testName = 'Varying number of participants: 10 consumers - 10 producers - PERSISTENT'
+series.1.colourName=red
+series.1.legend=Throughput
\ No newline at end of file
diff --git a/java/perftests/etc/chartdefs/timeseries/1030-Batch-Size-Small.chartdef b/java/perftests/etc/chartdefs/timeseries/1030-Batch-Size-Small.chartdef
new file mode 100644
index 0000000000..f755bf4a5b
--- /dev/null
+++ b/java/perftests/etc/chartdefs/timeseries/1030-Batch-Size-Small.chartdef
@@ -0,0 +1,30 @@
+#
+# 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=TIMELINE
+chartTitle=Transactions
+chartSubtitle=Persistent 1KB messages
+chartDescription=1P 1C, persistent, transacted with message payload 1KB with batch size 1 for both P and C
+
+xAxisTitle=Date
+yAxisTitle=Throughput (KB/s)
+
+series.1.statement=SELECT insertedTimestamp, throughputKbPerS FROM RESULTS WHERE participantName = 'All' AND testName = 'Batch Size 1-1 - PERSISTENT'
+series.1.colourName=red
+series.1.legend=Throughput
\ No newline at end of file
diff --git a/java/perftests/etc/chartdefs/timeseries/1031-Batch-Size-Large.chartdef b/java/perftests/etc/chartdefs/timeseries/1031-Batch-Size-Large.chartdef
new file mode 100644
index 0000000000..ca390f8226
--- /dev/null
+++ b/java/perftests/etc/chartdefs/timeseries/1031-Batch-Size-Large.chartdef
@@ -0,0 +1,30 @@
+#
+# 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=TIMELINE
+chartTitle=Transactions with large batches
+chartSubtitle=Persistent 1KB messages
+chartDescription=1P 1C, persistent, transacted with message payload 1KB with batch size 100 for both P and C
+
+xAxisTitle=Date
+yAxisTitle=Throughput (KB/s)
+
+series.1.statement=SELECT insertedTimestamp, throughputKbPerS FROM RESULTS WHERE participantName = 'All' AND testName = 'Batch Size 100-100 - PERSISTENT'
+series.1.colourName=red
+series.1.legend=Throughput
diff --git a/java/perftests/etc/chartdefs/timeseries/1040-SortedQueue.chartdef b/java/perftests/etc/chartdefs/timeseries/1040-SortedQueue.chartdef
new file mode 100644
index 0000000000..6dce3a1a77
--- /dev/null
+++ b/java/perftests/etc/chartdefs/timeseries/1040-SortedQueue.chartdef
@@ -0,0 +1,30 @@
+#
+# 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=TIMELINE
+chartTitle=Sorted queue
+chartSubtitle=Persistent 1KB messages
+chartDescription=1P 1C, persistent, auto-ack with message payload 1KB. Sorted queue with 160,000 random keys
+
+xAxisTitle=Date
+yAxisTitle=Throughput (KB/s)
+
+series.1.statement=SELECT insertedTimestamp, throughputKbPerS FROM RESULTS WHERE participantName = 'All' AND testName = 'queue-type:sorted-queue'
+series.1.colourName=red
+series.1.legend=Throughput
\ No newline at end of file
diff --git a/java/perftests/etc/perftests-jndi.properties b/java/perftests/etc/perftests-jndi.properties
index f33af6fdd5..ce6493b49a 100644
--- a/java/perftests/etc/perftests-jndi.properties
+++ b/java/perftests/etc/perftests-jndi.properties
@@ -20,3 +20,7 @@ java.naming.factory.initial = org.apache.qpid.jndi.PropertiesFileInitialContextF
connectionfactory.connectionfactory = amqp://guest:guest@clientid/test?brokerlist='tcp://localhost:5672'
destination.controllerqueue = direct://amq.direct//controllerqueue?autodelete='true'
+
+jdbcDriverClass=org.apache.derby.jdbc.EmbeddedDriver
+# writes to a results database in ./perftestResultsDb by default.
+jdbcUrl=jdbc:derby:perftestResultsDb;create=true
diff --git a/java/perftests/etc/run-perftests.sh b/java/perftests/etc/run-perftests.sh
new file mode 100755
index 0000000000..f963879e7e
--- /dev/null
+++ b/java/perftests/etc/run-perftests.sh
@@ -0,0 +1,37 @@
+#!/bin/bash
+#
+# 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.
+#
+
+# Runs the perftests using a typical configuration.
+
+BASE_DIR=`dirname $0`
+DURATION=${1:-5000}
+AMQP_VERSION=${2:-0-91}
+
+echo Will run perftests using a maximum duration of ${DURATION}ms and AMQP protocol version ${AMQP_VERSION}.
+echo
+
+java -cp "${BASE_DIR}:${BASE_DIR}/../../build/lib/*" \
+ -Dqpid.amqp.version=${AMQP_VERSION} -Dqpid.dest_syntax=BURL \
+ -Dqpid.disttest.duration=$DURATION \
+ org.apache.qpid.disttest.ControllerRunner \
+ jndi-config=${BASE_DIR}/perftests-jndi.properties \
+ test-config=${BASE_DIR}/testdefs \
+ distributed=false \
+ writeToDb=true
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/etc/testdefs/QueueConsumersWithNonOverlappingSelectors.js b/java/perftests/etc/testdefs/QueueConsumersWithNonOverlappingSelectors.js
new file mode 100644
index 0000000000..0dd45b0392
--- /dev/null
+++ b/java/perftests/etc/testdefs/QueueConsumersWithNonOverlappingSelectors.js
@@ -0,0 +1,120 @@
+/*
+ *
+ * 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:[]
+};
+
+for (var i=0; i<2; i++)
+{
+ var deliveryMode = i+1;
+ var durable = (deliveryMode == 2);
+ var suffix = durable ? "PERSISTENT" : "NON-PERSISTENT";
+ var queueName = "direct://amq.direct//queue-selectors-" + suffix + "?durable='" + durable + "'";
+ var consumerNumbers = [1, 2, 4, 8, 16, 32];
+ var consumerAcknowledgeMode = 1;
+ for (var j=0; j
-
+
diff --git a/java/perftests/example/perftests-jndi.properties b/java/perftests/example/perftests-jndi.properties
index 04a8ad9101..1c0fd57663 100644
--- a/java/perftests/example/perftests-jndi.properties
+++ b/java/perftests/example/perftests-jndi.properties
@@ -24,3 +24,6 @@ java.naming.factory.initial = org.apache.qpid.jndi.PropertiesFileInitialContextF
connectionfactory.connectionfactory = amqp://guest:guest@clientid/test?brokerlist='tcp://localhost:5672'
destination.controllerqueue = direct://amq.direct//controllerqueue?autodelete='true'
+
+driverName=org.apache.derby.jdbc.EmbeddedDriver
+jdbcUrl=jdbc:derby:/tmp/perftestResultsDb;create=true
diff --git a/java/perftests/example/run.sh b/java/perftests/example/run.sh
index cb68c52853..31124a060a 100755
--- a/java/perftests/example/run.sh
+++ b/java/perftests/example/run.sh
@@ -18,5 +18,5 @@
# under the License.
#
-java -cp ".:${QPID_HOME}/lib/*" -Dqpid.dest_syntax=BURL org.apache.qpid.disttest.ControllerRunner jndi-config=perftests-jndi.properties test-config=$1 distributed=false
+java -cp ".:${QPID_HOME}/lib/*" -Dqpid.dest_syntax=BURL org.apache.qpid.disttest.ControllerRunner jndi-config=perftests-jndi.properties test-config=$1 distributed=false writeToDb=true
diff --git a/java/perftests/src/main/java/org/apache/qpid/disttest/ArgumentParser.java b/java/perftests/src/main/java/org/apache/qpid/disttest/ArgumentParser.java
index 8c1f8675e3..e962bfe799 100644
--- a/java/perftests/src/main/java/org/apache/qpid/disttest/ArgumentParser.java
+++ b/java/perftests/src/main/java/org/apache/qpid/disttest/ArgumentParser.java
@@ -34,10 +34,14 @@ public class ArgumentParser
throw new IllegalArgumentException("arguments must have format =: " + arg);
}
- if(initialValues.put(splitArg[0], splitArg[1]) == null)
+
+ String argumentKey = splitArg[0];
+ String argumentValue = splitArg[1];
+ if(!initialValues.containsKey(argumentKey))
{
throw new IllegalArgumentException("not a valid configuration property: " + arg);
}
+ initialValues.put(argumentKey, argumentValue);
}
}
diff --git a/java/perftests/src/main/java/org/apache/qpid/disttest/ConfigFileHelper.java b/java/perftests/src/main/java/org/apache/qpid/disttest/ConfigFileHelper.java
index fb4c1b700b..ee374e180d 100644
--- a/java/perftests/src/main/java/org/apache/qpid/disttest/ConfigFileHelper.java
+++ b/java/perftests/src/main/java/org/apache/qpid/disttest/ConfigFileHelper.java
@@ -60,15 +60,4 @@ public class ConfigFileHelper
return testConfigFile;
}
-
- /**
- * generateOutputCsvNameFrom("/config/testConfigFile.js", "/output") returns /output/testConfigFile.csv
- */
- public String generateOutputCsvNameFrom(String testConfigFile, String outputDir)
- {
- final String filenameOnlyWithExtension = new File(testConfigFile).getName();
- final String cvsFile = filenameOnlyWithExtension.replaceFirst(".?\\w*$", ".csv");
-
- return new File(outputDir, cvsFile).getAbsolutePath();
- }
}
diff --git a/java/perftests/src/main/java/org/apache/qpid/disttest/ControllerRunner.java b/java/perftests/src/main/java/org/apache/qpid/disttest/ControllerRunner.java
index aea0ea301a..449130a328 100644
--- a/java/perftests/src/main/java/org/apache/qpid/disttest/ControllerRunner.java
+++ b/java/perftests/src/main/java/org/apache/qpid/disttest/ControllerRunner.java
@@ -19,9 +19,9 @@
*/
package org.apache.qpid.disttest;
+import java.io.File;
import java.io.FileNotFoundException;
-import java.io.FileWriter;
-import java.io.IOException;
+import java.util.ArrayList;
import java.util.List;
import javax.naming.Context;
@@ -30,9 +30,9 @@ import org.apache.qpid.disttest.controller.Controller;
import org.apache.qpid.disttest.controller.ResultsForAllTests;
import org.apache.qpid.disttest.controller.config.Config;
import org.apache.qpid.disttest.controller.config.ConfigReader;
+import org.apache.qpid.disttest.db.ResultsDbWriter;
import org.apache.qpid.disttest.jms.ControllerJmsDelegate;
import org.apache.qpid.disttest.results.aggregation.Aggregator;
-import org.apache.qpid.disttest.results.formatting.CSVFormater;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -43,20 +43,29 @@ public class ControllerRunner extends AbstractRunner
public static final String TEST_CONFIG_PROP = "test-config";
public static final String DISTRIBUTED_PROP = "distributed";
public static final String OUTPUT_DIR_PROP = "outputdir";
+ public static final String WRITE_TO_DB = "writeToDb";
+ public static final String RUN_ID = "runId";
private static final String TEST_CONFIG_DEFAULT = "perftests-config.json";
private static final String DISTRIBUTED_DEFAULT = "false";
private static final String OUTPUT_DIR_DEFAULT = ".";
+ public static final String WRITE_TO_DB_DEFAULT = "false";
private final Aggregator _aggregator = new Aggregator();
private final ConfigFileHelper _configFileHelper = new ConfigFileHelper();
+ private ResultsFileWriter _resultsFileWriter;
+
+ private ResultsDbWriter _resultsDbWriter;
+
public ControllerRunner()
{
getCliOptions().put(TEST_CONFIG_PROP, TEST_CONFIG_DEFAULT);
getCliOptions().put(DISTRIBUTED_PROP, DISTRIBUTED_DEFAULT);
getCliOptions().put(OUTPUT_DIR_PROP, OUTPUT_DIR_DEFAULT);
+ getCliOptions().put(WRITE_TO_DB, WRITE_TO_DB_DEFAULT);
+ getCliOptions().put(RUN_ID, null);
}
public static void main(String[] args) throws Exception
@@ -69,6 +78,8 @@ public class ControllerRunner extends AbstractRunner
public void runController() throws Exception
{
Context context = getContext();
+ setUpResultFilesWriter();
+ setUpResultsDbWriter();
ControllerJmsDelegate jmsDelegate = new ControllerJmsDelegate(context);
@@ -82,6 +93,24 @@ public class ControllerRunner extends AbstractRunner
}
}
+ private void setUpResultsDbWriter()
+ {
+ String writeToDbStr = getCliOptions().get(WRITE_TO_DB);
+ if(Boolean.valueOf(writeToDbStr))
+ {
+ String runId = getCliOptions().get(RUN_ID);
+ _resultsDbWriter = new ResultsDbWriter(getContext(), runId);
+ _resultsDbWriter.createResultsTableIfNecessary();
+ }
+ }
+
+ void setUpResultFilesWriter()
+ {
+ String outputDirString = getCliOptions().get(ControllerRunner.OUTPUT_DIR_PROP);
+ File outputDir = new File(outputDirString);
+ _resultsFileWriter = new ResultsFileWriter(outputDir);
+ }
+
private void runTests(ControllerJmsDelegate jmsDelegate)
{
Controller controller = new Controller(jmsDelegate, DistributedTestConstants.REGISTRATION_TIMEOUT, DistributedTestConstants.COMMAND_RESPONSE_TIMEOUT);
@@ -92,6 +121,8 @@ public class ControllerRunner extends AbstractRunner
try
{
+ List results = new ArrayList();
+
for (String testConfigFile : testConfigFiles)
{
final Config testConfig = buildTestConfigFrom(testConfigFile);
@@ -100,8 +131,11 @@ public class ControllerRunner extends AbstractRunner
controller.awaitClientRegistrations();
LOGGER.info("Running test : " + testConfigFile);
- runTest(controller, testConfigFile);
+ ResultsForAllTests testResult = runTest(controller, testConfigFile);
+ results.add(testResult);
}
+
+ _resultsFileWriter.writeResultsSummary(results);
}
catch(Exception e)
{
@@ -113,7 +147,7 @@ public class ControllerRunner extends AbstractRunner
}
}
- private void runTest(Controller controller, String testConfigFile)
+ private ResultsForAllTests runTest(Controller controller, String testConfigFile)
{
final Config testConfig = buildTestConfigFrom(testConfigFile);
controller.setConfig(testConfig);
@@ -121,9 +155,13 @@ public class ControllerRunner extends AbstractRunner
ResultsForAllTests rawResultsForAllTests = controller.runAllTests();
ResultsForAllTests resultsForAllTests = _aggregator.aggregateResults(rawResultsForAllTests);
- String outputDir = getCliOptions().get(ControllerRunner.OUTPUT_DIR_PROP);
- final String outputFile = _configFileHelper.generateOutputCsvNameFrom(testConfigFile, outputDir);
- writeResultsToFile(resultsForAllTests, outputFile);
+ _resultsFileWriter.writeResultsToFile(resultsForAllTests, testConfigFile);
+ if(_resultsDbWriter != null)
+ {
+ _resultsDbWriter.writeResults(resultsForAllTests);
+ }
+
+ return resultsForAllTests;
}
private void createClientsIfNotDistributed(final List testConfigFiles)
@@ -148,36 +186,6 @@ public class ControllerRunner extends AbstractRunner
}
}
- private void writeResultsToFile(ResultsForAllTests resultsForAllTests, String outputFile)
- {
- FileWriter writer = null;
- try
- {
- final String outputCsv = new CSVFormater().format(resultsForAllTests);
- writer = new FileWriter(outputFile);
- writer.write(outputCsv);
- LOGGER.info("Wrote " + resultsForAllTests.getTestResults().size() + " test result(s) to output file " + outputFile);
- }
- catch (IOException e)
- {
- throw new DistributedTestException("Unable to write output file " + outputFile, e);
- }
- finally
- {
- if (writer != null)
- {
- try
- {
- writer.close();
- }
- catch (IOException e)
- {
- LOGGER.error("Failed to close stream for file " + outputFile, e);
- }
- }
- }
- }
-
private Config buildTestConfigFrom(String testConfigFile)
{
ConfigReader configReader = new ConfigReader();
diff --git a/java/perftests/src/main/java/org/apache/qpid/disttest/ResultsFileWriter.java b/java/perftests/src/main/java/org/apache/qpid/disttest/ResultsFileWriter.java
new file mode 100644
index 0000000000..81b717403d
--- /dev/null
+++ b/java/perftests/src/main/java/org/apache/qpid/disttest/ResultsFileWriter.java
@@ -0,0 +1,112 @@
+/*
+ * 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.
+ */
+package org.apache.qpid.disttest;
+
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.util.List;
+
+import org.apache.qpid.disttest.controller.ResultsForAllTests;
+import org.apache.qpid.disttest.results.aggregation.TestResultAggregator;
+import org.apache.qpid.disttest.results.formatting.CSVFormatter;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class ResultsFileWriter
+{
+ private static final Logger LOGGER = LoggerFactory.getLogger(ResultsFileWriter.class);
+
+ static final String TEST_SUMMARY_FILE_NAME = "test-summary.csv";
+
+ private final File _outputDir;
+
+ private CSVFormatter _csvFormater = new CSVFormatter();
+
+ private TestResultAggregator _testResultAggregator = new TestResultAggregator();
+
+ public ResultsFileWriter(File outputDir)
+ {
+ _outputDir = outputDir;
+ }
+
+ public void writeResultsToFile(ResultsForAllTests resultsForAllTests, String testConfigFile)
+ {
+ final String outputFile = generateOutputCsvNameFrom(testConfigFile);
+ writeResultsToOutputFile(resultsForAllTests, outputFile);
+ }
+
+ public void writeResultsSummary(List allResultsList)
+ {
+ ResultsForAllTests combinedResults = _testResultAggregator.aggregateTestResults(allResultsList);
+ writeResultsToOutputFile(combinedResults, new File(_outputDir, TEST_SUMMARY_FILE_NAME).getAbsolutePath());
+ }
+
+ /**
+ * generateOutputCsvNameFrom("/config/testConfigFile.js", "/output") returns /output/testConfigFile.csv
+ */
+ private String generateOutputCsvNameFrom(String testConfigFile)
+ {
+ final String filenameOnlyWithExtension = new File(testConfigFile).getName();
+ final String cvsFile = filenameOnlyWithExtension.replaceFirst(".?\\w*$", ".csv");
+
+ return new File(_outputDir, cvsFile).getAbsolutePath();
+ }
+
+ private void writeResultsToOutputFile(ResultsForAllTests resultsForAllTests, String outputFile)
+ {
+ FileWriter writer = null;
+ try
+ {
+ final String outputCsv = _csvFormater.format(resultsForAllTests);
+ writer = new FileWriter(outputFile);
+ writer.write(outputCsv);
+ LOGGER.info("Wrote " + resultsForAllTests.getTestResults().size() + " test result(s) to output file " + outputFile);
+ }
+ catch (IOException e)
+ {
+ throw new DistributedTestException("Unable to write output file " + outputFile, e);
+ }
+ finally
+ {
+ if (writer != null)
+ {
+ try
+ {
+ writer.close();
+ }
+ catch (IOException e)
+ {
+ LOGGER.error("Failed to close stream for file " + outputFile, e);
+ }
+ }
+ }
+ }
+
+ void setCsvFormater(CSVFormatter csvFormater)
+ {
+ _csvFormater = csvFormater;
+ }
+
+ void setTestResultAggregator(TestResultAggregator testResultAggregator)
+ {
+ _testResultAggregator = testResultAggregator;
+ }
+
+}
diff --git a/java/perftests/src/main/java/org/apache/qpid/disttest/client/ConsumerParticipant.java b/java/perftests/src/main/java/org/apache/qpid/disttest/client/ConsumerParticipant.java
index f9d50e8e64..d3a5e30191 100644
--- a/java/perftests/src/main/java/org/apache/qpid/disttest/client/ConsumerParticipant.java
+++ b/java/perftests/src/main/java/org/apache/qpid/disttest/client/ConsumerParticipant.java
@@ -35,7 +35,6 @@ import javax.jms.MessageListener;
import org.apache.qpid.disttest.DistributedTestException;
import org.apache.qpid.disttest.jms.ClientJmsDelegate;
-import org.apache.qpid.disttest.message.ConsumerParticipantResult;
import org.apache.qpid.disttest.message.CreateConsumerCommand;
import org.apache.qpid.disttest.message.ParticipantResult;
import org.slf4j.Logger;
@@ -103,16 +102,22 @@ public class ConsumerParticipant implements Participant
}
Date end = new Date();
- int numberOfMessagesSent = _totalNumberOfMessagesReceived.get();
+ int numberOfMessagesReceived = _totalNumberOfMessagesReceived.get();
long totalPayloadSize = _totalPayloadSizeOfAllMessagesReceived.get();
int payloadSize = getPayloadSizeForResultIfConstantOrZeroOtherwise(_allConsumedPayloadSizes);
- ConsumerParticipantResult result = _resultFactory.createForConsumer(
+ if (LOGGER.isInfoEnabled())
+ {
+ LOGGER.info("Consumer {} finished consuming. Number of messages consumed: {}",
+ getName(), numberOfMessagesReceived);
+ }
+
+ ParticipantResult result = _resultFactory.createForConsumer(
getName(),
registeredClientName,
_command,
acknowledgeMode,
- numberOfMessagesSent,
+ numberOfMessagesReceived,
payloadSize,
totalPayloadSize,
start, end, _messageLatencies);
@@ -174,7 +179,7 @@ public class ConsumerParticipant implements Participant
{
LOGGER.trace("Committing: batch size " + _command.getBatchSize() );
}
- _jmsDelegate.commitOrAcknowledgeMessage(message, _command.getSessionName());
+ _jmsDelegate.commitOrAcknowledgeMessageIfNecessary(_command.getSessionName(), message);
}
}
@@ -199,7 +204,7 @@ public class ConsumerParticipant implements Participant
}
// commit/acknowledge remaining messages if necessary
- _jmsDelegate.commitOrAcknowledgeMessage(message, _command.getSessionName());
+ _jmsDelegate.commitOrAcknowledgeMessageIfNecessary(_command.getSessionName(), message);
}
return false;
}
diff --git a/java/perftests/src/main/java/org/apache/qpid/disttest/client/ParticipantExecutor.java b/java/perftests/src/main/java/org/apache/qpid/disttest/client/ParticipantExecutor.java
index bb9ce26f7e..10f62708a4 100644
--- a/java/perftests/src/main/java/org/apache/qpid/disttest/client/ParticipantExecutor.java
+++ b/java/perftests/src/main/java/org/apache/qpid/disttest/client/ParticipantExecutor.java
@@ -108,8 +108,16 @@ public class ParticipantExecutor
}
finally
{
+ try
+ {
+ _participant.releaseResources();
+ }
+ catch(Exception e)
+ {
+ LOGGER.error("Participant " + _participant + " unable to release resources", e);
+ }
+
_client.sendResults(result);
- _participant.releaseResources();
}
}
}
diff --git a/java/perftests/src/main/java/org/apache/qpid/disttest/client/ProducerParticipant.java b/java/perftests/src/main/java/org/apache/qpid/disttest/client/ProducerParticipant.java
index 63cbe98b5c..a9da837dea 100644
--- a/java/perftests/src/main/java/org/apache/qpid/disttest/client/ProducerParticipant.java
+++ b/java/perftests/src/main/java/org/apache/qpid/disttest/client/ProducerParticipant.java
@@ -58,17 +58,25 @@ public class ProducerParticipant implements Participant
@Override
public ParticipantResult doIt(String registeredClientName) throws Exception
{
- if (_command.getMaximumDuration() == 0 && _command.getNumberOfMessages() == 0)
+ long numberOfMessages = _command.getNumberOfMessages();
+ long maximumDuration = _command.getMaximumDuration();
+
+ if (maximumDuration == 0 && numberOfMessages == 0)
{
throw new DistributedTestException("number of messages and duration cannot both be zero");
}
- int acknowledgeMode = _jmsDelegate.getAcknowledgeMode(_command.getSessionName());
+ long duration = maximumDuration - _command.getStartDelay();
+ if (maximumDuration > 0 && duration <= 0)
+ {
+ throw new DistributedTestException("Start delay must be less than maximum test duration");
+ }
+ final long requiredDuration = duration > 0 ? duration : 0;
doSleepForStartDelay();
- final long requiredDuration = _command.getMaximumDuration() - _command.getStartDelay();
-
+ final int batchSize = _command.getBatchSize();
+ final int acknowledgeMode = _jmsDelegate.getAcknowledgeMode(_command.getSessionName());
final long startTime = System.currentTimeMillis();
Message lastPublishedMessage = null;
@@ -78,10 +86,20 @@ public class ProducerParticipant implements Participant
_limiter = ExecutorWithLimitsFactory.createExecutorWithLimit(startTime, requiredDuration);
- LOGGER.info("Producer {} about to send messages", getName());
+ if (LOGGER.isInfoEnabled())
+ {
+ LOGGER.info("Producer {} about to send messages. Duration limit: {} ms, Message limit: {}",
+ new Object[]{getName(), requiredDuration, numberOfMessages});
+ }
while (true)
{
+ if (numberOfMessages > 0 && numberOfMessagesSent >= numberOfMessages
+ || requiredDuration > 0 && System.currentTimeMillis() - startTime >= requiredDuration)
+ {
+ break;
+ }
+
try
{
lastPublishedMessage = _limiter.execute(new Callable()
@@ -110,35 +128,35 @@ public class ProducerParticipant implements Participant
LOGGER.trace("message " + numberOfMessagesSent + " sent by " + this);
}
- final boolean batchLimitReached = _command.getBatchSize() <= 0
- || numberOfMessagesSent % _command.getBatchSize() == 0;
+ final boolean batchLimitReached = batchSize <= 0
+ || numberOfMessagesSent % batchSize == 0;
if (batchLimitReached)
{
- if (LOGGER.isTraceEnabled() && _command.getBatchSize() > 0)
+ if (LOGGER.isTraceEnabled() && batchSize > 0)
{
- LOGGER.trace("Committing: batch size " + _command.getBatchSize() );
+ LOGGER.trace("Committing: batch size " + batchSize );
}
- _jmsDelegate.commitOrAcknowledgeMessage(lastPublishedMessage, _command.getSessionName());
+ _jmsDelegate.commitIfNecessary(_command.getSessionName());
doSleepForInterval();
}
-
- if (_command.getNumberOfMessages() > 0 && numberOfMessagesSent >= _command.getNumberOfMessages()
- || requiredDuration > 0 && System.currentTimeMillis() - startTime >= requiredDuration)
- {
- break;
- }
}
// commit the remaining batch messages
- if (_command.getBatchSize() > 0 && numberOfMessagesSent % _command.getBatchSize() != 0)
+ if (batchSize > 0 && numberOfMessagesSent % batchSize != 0)
{
if (LOGGER.isTraceEnabled())
{
- LOGGER.trace("Committing: batch size " + _command.getBatchSize() );
+ LOGGER.trace("Committing: batch size " + batchSize );
}
- _jmsDelegate.commitOrAcknowledgeMessage(lastPublishedMessage, _command.getSessionName());
+ _jmsDelegate.commitIfNecessary(_command.getSessionName());
+ }
+
+ if (LOGGER.isInfoEnabled())
+ {
+ LOGGER.info("Producer {} finished publishing. Number of messages published: {}",
+ getName(), numberOfMessagesSent);
}
Date start = new Date(startTime);
diff --git a/java/perftests/src/main/java/org/apache/qpid/disttest/controller/ClientRegistry.java b/java/perftests/src/main/java/org/apache/qpid/disttest/controller/ClientRegistry.java
index eaccb54f0e..5a726c50b4 100644
--- a/java/perftests/src/main/java/org/apache/qpid/disttest/controller/ClientRegistry.java
+++ b/java/perftests/src/main/java/org/apache/qpid/disttest/controller/ClientRegistry.java
@@ -57,34 +57,54 @@ public class ClientRegistry
return Collections.unmodifiableSet(_registeredClientNames);
}
- public int awaitClients(int numberOfClientsToAwait, long timeout)
+ /**
+ * @return the number of clients that are still absent.
+ */
+ public int awaitClients(final int numberOfClientsToAwait, final long idleTimeout)
{
- final long endTime = System.currentTimeMillis() + timeout;
+ long deadlineForNextRegistration = deadline(idleTimeout);
- int numberOfClientsAbsent = numberOfClientsToAwait - _registeredClientNames.size();
- long remainingTimeout = endTime - System.currentTimeMillis();
+ int numberOfClientsAbsent = numberAbsent(numberOfClientsToAwait);
- while(numberOfClientsAbsent > 0 && remainingTimeout > 0)
+ while(numberOfClientsAbsent > 0 && System.currentTimeMillis() < deadlineForNextRegistration)
{
synchronized (_lock)
{
try
{
- _lock.wait(remainingTimeout);
+ _lock.wait(idleTimeout);
}
catch (InterruptedException e)
{
Thread.currentThread().interrupt();
+ return numberOfClientsAbsent;
}
}
- numberOfClientsAbsent = numberOfClientsToAwait - _registeredClientNames.size();
- remainingTimeout = endTime - System.currentTimeMillis();
+ int newNumberAbsent = numberAbsent(numberOfClientsToAwait);
+ if(newNumberAbsent < numberOfClientsAbsent)
+ {
+ // a registration was received since the last loop, so reset the timeout
+ deadlineForNextRegistration = deadline(idleTimeout);
+ }
+
+ numberOfClientsAbsent = newNumberAbsent;
}
return numberOfClientsAbsent < 0 ? 0 : numberOfClientsAbsent;
}
+
+ private long deadline(final long idleTimeout)
+ {
+ return System.currentTimeMillis() + idleTimeout;
+ }
+
+ private int numberAbsent(int numberOfClientsToAwait)
+ {
+ return numberOfClientsToAwait - _registeredClientNames.size();
+ }
+
private void notifyAllWaiters()
{
synchronized (_lock)
diff --git a/java/perftests/src/main/java/org/apache/qpid/disttest/controller/ResultsForAllTests.java b/java/perftests/src/main/java/org/apache/qpid/disttest/controller/ResultsForAllTests.java
index 6c5ff3450c..d4474e2c12 100644
--- a/java/perftests/src/main/java/org/apache/qpid/disttest/controller/ResultsForAllTests.java
+++ b/java/perftests/src/main/java/org/apache/qpid/disttest/controller/ResultsForAllTests.java
@@ -21,7 +21,9 @@ package org.apache.qpid.disttest.controller;
import java.util.ArrayList;
import java.util.List;
+import org.apache.qpid.disttest.message.ParticipantResult;
import org.apache.qpid.disttest.results.aggregation.ITestResult;
+import org.apache.qpid.disttest.results.aggregation.TestResultAggregator;
public class ResultsForAllTests
{
@@ -46,4 +48,23 @@ public class ResultsForAllTests
{
return _hasErrors;
}
+
+ public ResultsForAllTests getAllParticipantsResult()
+ {
+ ResultsForAllTests summaryResultsForAllTests = new ResultsForAllTests();
+
+ for (ITestResult testResult : _results)
+ {
+ for(ParticipantResult participantResult : testResult.getParticipantResults())
+ {
+ if(TestResultAggregator.ALL_CONSUMER_PARTICIPANTS_NAME.equals(participantResult.getParticipantName()))
+ {
+ TestResult summaryTestResult = new TestResult(testResult.getName());
+ summaryTestResult.addParticipantResult(participantResult);
+ summaryResultsForAllTests.add(summaryTestResult);
+ }
+ }
+ }
+ return summaryResultsForAllTests;
+ }
}
diff --git a/java/perftests/src/main/java/org/apache/qpid/disttest/controller/config/ConsumerConfig.java b/java/perftests/src/main/java/org/apache/qpid/disttest/controller/config/ConsumerConfig.java
index 110de8a4ea..dcccccdd5f 100644
--- a/java/perftests/src/main/java/org/apache/qpid/disttest/controller/config/ConsumerConfig.java
+++ b/java/perftests/src/main/java/org/apache/qpid/disttest/controller/config/ConsumerConfig.java
@@ -24,7 +24,6 @@ import org.apache.qpid.disttest.message.CreateConsumerCommand;
public class ConsumerConfig extends ParticipantConfig
{
- private boolean _isTopic;
private boolean _isDurableSubscription;
private boolean _isBrowsingSubscription;
private String _selector;
@@ -35,7 +34,6 @@ public class ConsumerConfig extends ParticipantConfig
// For Gson
public ConsumerConfig()
{
- _isTopic = false;
_isDurableSubscription = false;
_isBrowsingSubscription = false;
_selector = null;
@@ -56,9 +54,8 @@ public class ConsumerConfig extends ParticipantConfig
boolean noLocal,
boolean synchronous)
{
- super(consumerName, destinationName, numberOfMessages, batchSize, maximumDuration);
+ super(consumerName, destinationName, isTopic, numberOfMessages, batchSize, maximumDuration);
- _isTopic = isTopic;
_isDurableSubscription = isDurableSubscription;
_isBrowsingSubscription = isBrowsingSubscription;
_selector = selector;
@@ -73,7 +70,6 @@ public class ConsumerConfig extends ParticipantConfig
setParticipantProperties(createConsumerCommand);
createConsumerCommand.setSessionName(sessionName);
- createConsumerCommand.setTopic(_isTopic);
createConsumerCommand.setDurableSubscription(_isDurableSubscription);
createConsumerCommand.setBrowsingSubscription(_isBrowsingSubscription);
createConsumerCommand.setSelector(_selector);
diff --git a/java/perftests/src/main/java/org/apache/qpid/disttest/controller/config/ParticipantConfig.java b/java/perftests/src/main/java/org/apache/qpid/disttest/controller/config/ParticipantConfig.java
index 16f7b0d18d..99ae4b7426 100644
--- a/java/perftests/src/main/java/org/apache/qpid/disttest/controller/config/ParticipantConfig.java
+++ b/java/perftests/src/main/java/org/apache/qpid/disttest/controller/config/ParticipantConfig.java
@@ -33,6 +33,7 @@ public abstract class ParticipantConfig
private boolean _alreadyLoggedAboutOverriddenDuration;
private String _destinationName;
+ private boolean _isTopic;
private long _numberOfMessages;
private String _name;
private int _batchSize;
@@ -51,12 +52,14 @@ public abstract class ParticipantConfig
public ParticipantConfig(
String name,
String destinationName,
+ boolean isTopic,
long numberOfMessages,
int batchSize,
long maximumDuration)
{
_name = name;
_destinationName = destinationName;
+ _isTopic = isTopic;
_numberOfMessages = numberOfMessages;
_batchSize = batchSize;
_maximumDuration = maximumDuration;
@@ -66,6 +69,7 @@ public abstract class ParticipantConfig
{
createParticipantCommand.setParticipantName(_name);
createParticipantCommand.setDestinationName(_destinationName);
+ createParticipantCommand.setTopic(_isTopic);
createParticipantCommand.setNumberOfMessages(_numberOfMessages);
createParticipantCommand.setBatchSize(_batchSize);
diff --git a/java/perftests/src/main/java/org/apache/qpid/disttest/controller/config/ProducerConfig.java b/java/perftests/src/main/java/org/apache/qpid/disttest/controller/config/ProducerConfig.java
index f2369ed671..88c188d3ac 100644
--- a/java/perftests/src/main/java/org/apache/qpid/disttest/controller/config/ProducerConfig.java
+++ b/java/perftests/src/main/java/org/apache/qpid/disttest/controller/config/ProducerConfig.java
@@ -59,7 +59,7 @@ public class ProducerConfig extends ParticipantConfig
long startDelay,
String messageProviderName)
{
- super(producerName, destinationName, numberOfMessages, batchSize, maximumDuration);
+ super(producerName, destinationName, false, numberOfMessages, batchSize, maximumDuration);
_deliveryMode = deliveryMode;
_messageSize = messageSize;
diff --git a/java/perftests/src/main/java/org/apache/qpid/disttest/db/ResultsDbWriter.java b/java/perftests/src/main/java/org/apache/qpid/disttest/db/ResultsDbWriter.java
new file mode 100644
index 0000000000..fdea03ae5e
--- /dev/null
+++ b/java/perftests/src/main/java/org/apache/qpid/disttest/db/ResultsDbWriter.java
@@ -0,0 +1,467 @@
+/*
+ * 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.
+ *
+ */
+package org.apache.qpid.disttest.db;
+
+import static org.apache.qpid.disttest.message.ParticipantAttribute.ACKNOWLEDGE_MODE;
+import static org.apache.qpid.disttest.message.ParticipantAttribute.AVERAGE_LATENCY;
+import static org.apache.qpid.disttest.message.ParticipantAttribute.BATCH_SIZE;
+import static org.apache.qpid.disttest.message.ParticipantAttribute.CONFIGURED_CLIENT_NAME;
+import static org.apache.qpid.disttest.message.ParticipantAttribute.DELIVERY_MODE;
+import static org.apache.qpid.disttest.message.ParticipantAttribute.ERROR_MESSAGE;
+import static org.apache.qpid.disttest.message.ParticipantAttribute.IS_BROWSING_SUBSCRIPTION;
+import static org.apache.qpid.disttest.message.ParticipantAttribute.IS_DURABLE_SUBSCRIPTION;
+import static org.apache.qpid.disttest.message.ParticipantAttribute.IS_NO_LOCAL;
+import static org.apache.qpid.disttest.message.ParticipantAttribute.IS_SELECTOR;
+import static org.apache.qpid.disttest.message.ParticipantAttribute.IS_SYNCHRONOUS_CONSUMER;
+import static org.apache.qpid.disttest.message.ParticipantAttribute.IS_TOPIC;
+import static org.apache.qpid.disttest.message.ParticipantAttribute.ITERATION_NUMBER;
+import static org.apache.qpid.disttest.message.ParticipantAttribute.LATENCY_STANDARD_DEVIATION;
+import static org.apache.qpid.disttest.message.ParticipantAttribute.MAXIMUM_DURATION;
+import static org.apache.qpid.disttest.message.ParticipantAttribute.MAX_LATENCY;
+import static org.apache.qpid.disttest.message.ParticipantAttribute.MIN_LATENCY;
+import static org.apache.qpid.disttest.message.ParticipantAttribute.NUMBER_OF_MESSAGES_PROCESSED;
+import static org.apache.qpid.disttest.message.ParticipantAttribute.PARTICIPANT_NAME;
+import static org.apache.qpid.disttest.message.ParticipantAttribute.PAYLOAD_SIZE;
+import static org.apache.qpid.disttest.message.ParticipantAttribute.PRIORITY;
+import static org.apache.qpid.disttest.message.ParticipantAttribute.PRODUCER_INTERVAL;
+import static org.apache.qpid.disttest.message.ParticipantAttribute.PRODUCER_START_DELAY;
+import static org.apache.qpid.disttest.message.ParticipantAttribute.TEST_NAME;
+import static org.apache.qpid.disttest.message.ParticipantAttribute.THROUGHPUT;
+import static org.apache.qpid.disttest.message.ParticipantAttribute.TIME_TAKEN;
+import static org.apache.qpid.disttest.message.ParticipantAttribute.TIME_TO_LIVE;
+import static org.apache.qpid.disttest.message.ParticipantAttribute.TOTAL_NUMBER_OF_CONSUMERS;
+import static org.apache.qpid.disttest.message.ParticipantAttribute.TOTAL_NUMBER_OF_PRODUCERS;
+import static org.apache.qpid.disttest.message.ParticipantAttribute.TOTAL_PAYLOAD_PROCESSED;
+
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.Statement;
+import java.sql.Timestamp;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.Hashtable;
+import java.util.TimeZone;
+
+import javax.naming.Context;
+import javax.naming.NamingException;
+
+import org.apache.commons.lang.builder.ToStringBuilder;
+import org.apache.commons.lang.builder.ToStringStyle;
+import org.apache.log4j.Logger;
+import org.apache.qpid.disttest.controller.ResultsForAllTests;
+import org.apache.qpid.disttest.message.ParticipantResult;
+import org.apache.qpid.disttest.results.aggregation.ITestResult;
+
+/**
+ * Intended call sequence:
+ *
+ */
+public class ResultsDbWriter
+{
+ private static final Logger _logger = Logger.getLogger(ResultsDbWriter.class);
+
+ private static final String RESULTS_TABLE_NAME = "RESULTS";
+
+ /** column name */
+ static final String INSERTED_TIMESTAMP = "insertedTimestamp";
+ /** column name */
+ static final String RUN_ID = "runId";
+
+ private static final String TABLE_EXISTENCE_QUERY = "SELECT 1 FROM SYS.SYSTABLES WHERE TABLENAME = ?";
+
+ private static final String CREATE_RESULTS_TABLE = String.format(
+ "CREATE TABLE %1$s (" +
+ "%2$s varchar(200) not null" + // TEST_NAME
+ ", %3$s bigint not null" + // ITERATION_NUMBER
+ ", %4$s varchar(200) not null" + // PARTICIPANT_NAME
+ ", %5$s double not null" + // THROUGHPUT
+ ", %6$s double" + // AVERAGE_LATENCY
+ ", %7$s varchar(200)" + // CONFIGURED_CLIENT_NAME
+ ", %8$s bigint" + // NUMBER_OF_MESSAGES_PROCESSED
+ ", %9$s bigint" + // PAYLOAD_SIZE
+ ", %10$s bigint" + // PRIORITY
+ ", %11$s bigint" + // TIME_TO_LIVE
+ ", %12$s bigint" + // ACKNOWLEDGE_MODE
+ ", %13$s bigint" + // DELIVERY_MODE
+ ", %14$s bigint" + // BATCH_SIZE
+ ", %15$s bigint" + // MAXIMUM_DURATION
+ ", %16$s bigint" + // PRODUCER_START_DELAY
+ ", %17$s bigint" + // PRODUCER_INTERVAL
+ ", %18$s bigint" + // IS_TOPIC
+ ", %19$s bigint" + // IS_DURABLE_SUBSCRIPTION
+ ", %20$s bigint" + // IS_BROWSING_SUBSCRIPTION
+ ", %21$s bigint" + // IS_SELECTOR
+ ", %22$s bigint" + // IS_NO_LOCAL
+ ", %23$s bigint" + // IS_SYNCHRONOUS_CONSUMER
+ ", %24$s bigint" + // TOTAL_NUMBER_OF_CONSUMERS
+ ", %25$s bigint" + // TOTAL_NUMBER_OF_PRODUCERS
+ ", %26$s bigint" + // TOTAL_PAYLOAD_PROCESSED
+ ", %27$s bigint" + // TIME_TAKEN
+ ", %28$s varchar(2000)" + // ERROR_MESSAGE
+ ", %29$s bigint" + // MIN_LATENCY
+ ", %30$s bigint" + // MAX_LATENCY
+ ", %31$s double" + // LATENCY_STANDARD_DEVIATION
+ ", %32$s varchar(200) not null" +
+ ", %33$s timestamp not null" +
+ ")",
+ RESULTS_TABLE_NAME,
+ TEST_NAME.getDisplayName(),
+ ITERATION_NUMBER.getDisplayName(),
+ PARTICIPANT_NAME.getDisplayName(),
+ THROUGHPUT.getDisplayName(),
+ AVERAGE_LATENCY.getDisplayName(),
+ CONFIGURED_CLIENT_NAME.getDisplayName(),
+ NUMBER_OF_MESSAGES_PROCESSED.getDisplayName(),
+ PAYLOAD_SIZE.getDisplayName(),
+ PRIORITY.getDisplayName(),
+ TIME_TO_LIVE.getDisplayName(),
+ ACKNOWLEDGE_MODE.getDisplayName(),
+ DELIVERY_MODE.getDisplayName(),
+ BATCH_SIZE.getDisplayName(),
+ MAXIMUM_DURATION.getDisplayName(),
+ PRODUCER_START_DELAY.getDisplayName(),
+ PRODUCER_INTERVAL.getDisplayName(),
+ IS_TOPIC.getDisplayName(),
+ IS_DURABLE_SUBSCRIPTION.getDisplayName(),
+ IS_BROWSING_SUBSCRIPTION.getDisplayName(),
+ IS_SELECTOR.getDisplayName(),
+ IS_NO_LOCAL.getDisplayName(),
+ IS_SYNCHRONOUS_CONSUMER.getDisplayName(),
+ TOTAL_NUMBER_OF_CONSUMERS.getDisplayName(),
+ TOTAL_NUMBER_OF_PRODUCERS.getDisplayName(),
+ TOTAL_PAYLOAD_PROCESSED.getDisplayName(),
+ TIME_TAKEN.getDisplayName(),
+ ERROR_MESSAGE.getDisplayName(),
+ MIN_LATENCY.getDisplayName(),
+ MAX_LATENCY.getDisplayName(),
+ LATENCY_STANDARD_DEVIATION.getDisplayName(),
+ RUN_ID,
+ INSERTED_TIMESTAMP
+ );
+
+ public static final String DRIVER_NAME = "jdbcDriverClass";
+ public static final String URL = "jdbcUrl";
+
+ private final String _url;
+ private final String _runId;
+
+ private final Clock _clock;
+
+ /**
+ * @param runId may be null, in which case a default value is chosen based on current GMT time
+ * @param context must contain environment entries {@value #DRIVER_NAME} and {@value #URL}.
+ */
+ public ResultsDbWriter(Context context, String runId)
+ {
+ this(context, runId, new Clock());
+ }
+
+ /** only call directly from tests */
+ ResultsDbWriter(Context context, String runId, Clock clock)
+ {
+ _clock = clock;
+ _runId = defaultIfNullRunId(runId);
+
+ _url = initialiseJdbc(context);
+ }
+
+ private String defaultIfNullRunId(String runId)
+ {
+ if(runId == null)
+ {
+ Date dateNow = new Date(_clock.currentTimeMillis());
+ Calendar calNow = Calendar.getInstance(TimeZone.getTimeZone("GMT+00:00"));
+ calNow.setTime(dateNow);
+ return String.format("run %1$tF %1$tT.%tL", calNow);
+ }
+ else
+ {
+ return runId;
+ }
+ }
+
+ public String getRunId()
+ {
+ return _runId;
+ }
+
+ /**
+ * Uses the context's environment to load the JDBC driver class and return the
+ * JDBC URL specified therein.
+ * @return the JDBC URL
+ */
+ private String initialiseJdbc(Context context)
+ {
+ Hashtable, ?> environment = null;
+ try
+ {
+ environment = context.getEnvironment();
+
+ String driverName = (String) environment.get(DRIVER_NAME);
+ if(driverName == null)
+ {
+ throw new IllegalArgumentException("JDBC driver name " + DRIVER_NAME
+ + " missing from context environment: " + environment);
+ }
+
+ Class.forName(driverName);
+
+ Object url = environment.get(URL);
+ if(url == null)
+ {
+ throw new IllegalArgumentException("JDBC URL " + URL + " missing from context environment: " + environment);
+ }
+ return (String) url;
+ }
+ catch (NamingException e)
+ {
+ throw constructorRethrow(e, environment);
+ }
+ catch (ClassNotFoundException e)
+ {
+ throw constructorRethrow(e, environment);
+ }
+ }
+
+ private RuntimeException constructorRethrow(Exception e, Hashtable, ?> environment)
+ {
+ return new RuntimeException("Couldn't initialise ResultsDbWriter from context with environment" + environment, e);
+ }
+
+ public void createResultsTableIfNecessary()
+ {
+ try
+ {
+ Connection connection = null;
+ try
+ {
+ connection = DriverManager.getConnection(_url);
+ if(!tableExists(RESULTS_TABLE_NAME, connection))
+ {
+ Statement statement = connection.createStatement();
+ try
+ {
+ _logger.info("About to create results table using SQL: " + CREATE_RESULTS_TABLE);
+ statement.execute(CREATE_RESULTS_TABLE);
+ }
+ finally
+ {
+ statement.close();
+ }
+ }
+ }
+ finally
+ {
+ if(connection != null)
+ {
+ connection.close();
+ }
+ }
+ }
+ catch (SQLException e)
+ {
+ throw new RuntimeException("Couldn't create results table", e);
+ }
+
+ }
+
+ private boolean tableExists(final String tableName, final Connection conn) throws SQLException
+ {
+ PreparedStatement stmt = conn.prepareStatement(TABLE_EXISTENCE_QUERY);
+ try
+ {
+ stmt.setString(1, tableName);
+ ResultSet rs = stmt.executeQuery();
+ try
+ {
+ return rs.next();
+ }
+ finally
+ {
+ rs.close();
+ }
+ }
+ finally
+ {
+ stmt.close();
+ }
+ }
+
+ public void writeResults(ResultsForAllTests results)
+ {
+ try
+ {
+ writeResultsThrowingException(results);
+ }
+ catch (SQLException e)
+ {
+ throw new RuntimeException("Couldn't write results " + results, e);
+ }
+ _logger.info(this + " wrote " + results.getTestResults().size() + " results to database");
+ }
+
+ private void writeResultsThrowingException(ResultsForAllTests results) throws SQLException
+ {
+ Connection connection = null;
+ try
+ {
+ connection = DriverManager.getConnection(_url);
+
+ for (ITestResult testResult : results.getTestResults())
+ {
+ for (ParticipantResult participantResult : testResult.getParticipantResults())
+ {
+ writeParticipantResult(connection, participantResult);
+ }
+ }
+ }
+ finally
+ {
+ if(connection != null)
+ {
+ connection.close();
+ }
+ }
+ }
+
+ private void writeParticipantResult(Connection connection, ParticipantResult participantResult) throws SQLException
+ {
+ if(_logger.isDebugEnabled())
+ {
+ _logger.debug("About to write to DB the following participant result: " + participantResult);
+ }
+
+ PreparedStatement statement = null;
+ try
+ {
+ String sqlTemplate = String.format(
+ "INSERT INTO %s (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s) " +
+ "VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)",
+ RESULTS_TABLE_NAME,
+ TEST_NAME.getDisplayName(),
+ ITERATION_NUMBER.getDisplayName(),
+ PARTICIPANT_NAME.getDisplayName(),
+ THROUGHPUT.getDisplayName(),
+ AVERAGE_LATENCY.getDisplayName(),
+ CONFIGURED_CLIENT_NAME.getDisplayName(),
+ NUMBER_OF_MESSAGES_PROCESSED.getDisplayName(),
+ PAYLOAD_SIZE.getDisplayName(),
+ PRIORITY.getDisplayName(),
+ TIME_TO_LIVE.getDisplayName(),
+ ACKNOWLEDGE_MODE.getDisplayName(),
+ DELIVERY_MODE.getDisplayName(),
+ BATCH_SIZE.getDisplayName(),
+ MAXIMUM_DURATION.getDisplayName(),
+ PRODUCER_START_DELAY.getDisplayName(),
+ PRODUCER_INTERVAL.getDisplayName(),
+ IS_TOPIC.getDisplayName(),
+ IS_DURABLE_SUBSCRIPTION.getDisplayName(),
+ IS_BROWSING_SUBSCRIPTION.getDisplayName(),
+ IS_SELECTOR.getDisplayName(),
+ IS_NO_LOCAL.getDisplayName(),
+ IS_SYNCHRONOUS_CONSUMER.getDisplayName(),
+ TOTAL_NUMBER_OF_CONSUMERS.getDisplayName(),
+ TOTAL_NUMBER_OF_PRODUCERS.getDisplayName(),
+ TOTAL_PAYLOAD_PROCESSED.getDisplayName(),
+ TIME_TAKEN.getDisplayName(),
+ ERROR_MESSAGE.getDisplayName(),
+ MIN_LATENCY.getDisplayName(),
+ MAX_LATENCY.getDisplayName(),
+ LATENCY_STANDARD_DEVIATION.getDisplayName(),
+ RUN_ID,
+ INSERTED_TIMESTAMP
+ );
+ statement = connection.prepareStatement(sqlTemplate);
+
+ int columnIndex = 1;
+ statement.setString(columnIndex++, participantResult.getTestName());
+ statement.setInt(columnIndex++, participantResult.getIterationNumber());
+ statement.setString(columnIndex++, participantResult.getParticipantName());
+ statement.setDouble(columnIndex++, participantResult.getThroughput());
+ statement.setDouble(columnIndex++, participantResult.getAverageLatency());
+ statement.setString(columnIndex++, participantResult.getConfiguredClientName());
+ statement.setLong(columnIndex++, participantResult.getNumberOfMessagesProcessed());
+ statement.setLong(columnIndex++, participantResult.getPayloadSize());
+ statement.setLong(columnIndex++, participantResult.getPriority());
+ statement.setLong(columnIndex++, participantResult.getTimeToLive());
+ statement.setLong(columnIndex++, participantResult.getAcknowledgeMode());
+ statement.setLong(columnIndex++, participantResult.getDeliveryMode());
+ statement.setLong(columnIndex++, participantResult.getBatchSize());
+ statement.setLong(columnIndex++, participantResult.getMaximumDuration());
+ statement.setLong(columnIndex++, 0 /* TODO PRODUCER_START_DELAY*/);
+ statement.setLong(columnIndex++, 0 /* TODO PRODUCER_INTERVAL*/);
+ statement.setLong(columnIndex++, 0 /* TODO IS_TOPIC*/);
+ statement.setLong(columnIndex++, 0 /* TODO IS_DURABLE_SUBSCRIPTION*/);
+ statement.setLong(columnIndex++, 0 /* TODO IS_BROWSING_SUBSCRIPTION*/);
+ statement.setLong(columnIndex++, 0 /* TODO IS_SELECTOR*/);
+ statement.setLong(columnIndex++, 0 /* TODO IS_NO_LOCAL*/);
+ statement.setLong(columnIndex++, 0 /* TODO IS_SYNCHRONOUS_CONSUMER*/);
+ statement.setLong(columnIndex++, participantResult.getTotalNumberOfConsumers());
+ statement.setLong(columnIndex++, participantResult.getTotalNumberOfProducers());
+ statement.setLong(columnIndex++, participantResult.getTotalPayloadProcessed());
+ statement.setLong(columnIndex++, participantResult.getTimeTaken());
+ statement.setString(columnIndex++, participantResult.getErrorMessage());
+ statement.setLong(columnIndex++, participantResult.getMinLatency());
+ statement.setLong(columnIndex++, participantResult.getMaxLatency());
+ statement.setDouble(columnIndex++, participantResult.getLatencyStandardDeviation());
+
+ statement.setString(columnIndex++, _runId);
+ statement.setTimestamp(columnIndex++, new Timestamp(_clock.currentTimeMillis()));
+
+ statement.execute();
+ connection.commit();
+ }
+ catch(SQLException e)
+ {
+ _logger.error("Couldn't write " + participantResult, e);
+ }
+ finally
+ {
+ if (statement != null)
+ {
+ statement.close();
+ }
+ }
+ }
+
+ public static class Clock
+ {
+ public long currentTimeMillis()
+ {
+ return System.currentTimeMillis();
+ }
+ }
+
+ @Override
+ public String toString()
+ {
+ return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE)
+ .append("runId", _runId)
+ .append("url", _url)
+ .toString();
+ }
+}
diff --git a/java/perftests/src/main/java/org/apache/qpid/disttest/jms/ClientJmsDelegate.java b/java/perftests/src/main/java/org/apache/qpid/disttest/jms/ClientJmsDelegate.java
index 3f8afc9a9a..f242111dc5 100644
--- a/java/perftests/src/main/java/org/apache/qpid/disttest/jms/ClientJmsDelegate.java
+++ b/java/perftests/src/main/java/org/apache/qpid/disttest/jms/ClientJmsDelegate.java
@@ -218,7 +218,15 @@ public class ClientJmsDelegate
synchronized(session)
{
- final Destination destination = session.createQueue(command.getDestinationName());
+ final Destination destination;
+ if(command.isTopic())
+ {
+ destination = session.createTopic(command.getDestinationName());
+ }
+ else
+ {
+ destination = session.createQueue(command.getDestinationName());
+ }
final MessageProducer jmsProducer = session.createProducer(destination);
@@ -373,30 +381,6 @@ public class ClientJmsDelegate
}
}
- public void commitOrAcknowledgeMessage(final Message message, final String sessionName)
- {
- try
- {
- final Session session = _testSessions.get(sessionName);
- if (session.getTransacted())
- {
- synchronized(session)
- {
- session.commit();
- }
- }
- else if (message != null && session.getAcknowledgeMode() == Session.CLIENT_ACKNOWLEDGE)
- {
- message.acknowledge();
- }
- }
- catch (final JMSException jmse)
- {
- throw new DistributedTestException("Unable to commit or acknowledge message on session: " +
- sessionName, jmse);
- }
- }
-
public int getAcknowledgeMode(final String sessionName)
{
try
@@ -493,31 +477,36 @@ public class ClientJmsDelegate
}
}
- public void rollbackOrRecover(String sessionName)
+ public void commitOrAcknowledgeMessageIfNecessary(final String sessionName, final Message message)
{
try
{
final Session session = _testSessions.get(sessionName);
- synchronized(session)
+ if (session.getTransacted())
{
- if (session.getTransacted())
- {
- session.rollback();
- }
- else if (session.getAcknowledgeMode() == Session.CLIENT_ACKNOWLEDGE)
+ synchronized(session)
{
- session.recover();
+ session.commit();
}
}
+ else if (message != null && session.getAcknowledgeMode() == Session.CLIENT_ACKNOWLEDGE)
+ {
+ message.acknowledge();
+ }
}
catch (final JMSException jmse)
{
- throw new DistributedTestException("Unable to rollback or recover on session: " +
+ throw new DistributedTestException("Unable to commit or acknowledge message on session: " +
sessionName, jmse);
}
}
- public void releaseMessage(String sessionName)
+ public void commitIfNecessary(final String sessionName)
+ {
+ commitOrAcknowledgeMessageIfNecessary(sessionName, null);
+ }
+
+ public void rollbackOrRecoverIfNecessary(String sessionName)
{
try
{
@@ -528,7 +517,7 @@ public class ClientJmsDelegate
{
session.rollback();
}
- else
+ else if (session.getAcknowledgeMode() == Session.CLIENT_ACKNOWLEDGE)
{
session.recover();
}
@@ -536,7 +525,8 @@ public class ClientJmsDelegate
}
catch (final JMSException jmse)
{
- LOGGER.warn("Unable to rollback or recover on session: " + sessionName, jmse);
+ throw new DistributedTestException("Unable to rollback or recover on session: " +
+ sessionName, jmse);
}
}
diff --git a/java/perftests/src/main/java/org/apache/qpid/disttest/jms/ControllerJmsDelegate.java b/java/perftests/src/main/java/org/apache/qpid/disttest/jms/ControllerJmsDelegate.java
index c80e641e5c..782f7ae2fd 100644
--- a/java/perftests/src/main/java/org/apache/qpid/disttest/jms/ControllerJmsDelegate.java
+++ b/java/perftests/src/main/java/org/apache/qpid/disttest/jms/ControllerJmsDelegate.java
@@ -224,12 +224,12 @@ public class ControllerJmsDelegate
public void createQueues(List queues)
{
- _queueCreator.createQueues(_session, queues);
+ _queueCreator.createQueues(_connection, _session, queues);
}
public void deleteQueues(List queues)
{
- _queueCreator.deleteQueues(_session, queues);
+ _queueCreator.deleteQueues(_connection, _session, queues);
}
public void addCommandListener(CommandListener commandListener)
diff --git a/java/perftests/src/main/java/org/apache/qpid/disttest/jms/NoOpQueueCreator.java b/java/perftests/src/main/java/org/apache/qpid/disttest/jms/NoOpQueueCreator.java
index 4d4850eccf..d7e0007b28 100644
--- a/java/perftests/src/main/java/org/apache/qpid/disttest/jms/NoOpQueueCreator.java
+++ b/java/perftests/src/main/java/org/apache/qpid/disttest/jms/NoOpQueueCreator.java
@@ -20,18 +20,19 @@ package org.apache.qpid.disttest.jms;
import java.util.List;
+import javax.jms.Connection;
import javax.jms.Session;
import org.apache.qpid.disttest.controller.config.QueueConfig;
public class NoOpQueueCreator implements QueueCreator
{
@Override
- public void createQueues(Session session, List configs)
+ public void createQueues(Connection connection, Session session, List configs)
{
}
@Override
- public void deleteQueues(Session session, List configs)
+ public void deleteQueues(Connection connection, Session session, List configs)
{
}
}
diff --git a/java/perftests/src/main/java/org/apache/qpid/disttest/jms/QpidQueueCreator.java b/java/perftests/src/main/java/org/apache/qpid/disttest/jms/QpidQueueCreator.java
index 6874abe7d4..ef2cfb6cd4 100644
--- a/java/perftests/src/main/java/org/apache/qpid/disttest/jms/QpidQueueCreator.java
+++ b/java/perftests/src/main/java/org/apache/qpid/disttest/jms/QpidQueueCreator.java
@@ -20,21 +20,29 @@ package org.apache.qpid.disttest.jms;
import java.util.List;
+import javax.jms.Connection;
+import javax.jms.JMSException;
+import javax.jms.MessageConsumer;
import javax.jms.Session;
+
import org.apache.qpid.client.AMQDestination;
import org.apache.qpid.client.AMQSession;
import org.apache.qpid.disttest.DistributedTestException;
import org.apache.qpid.disttest.controller.config.QueueConfig;
+import org.apache.qpid.framing.AMQShortString;
import org.apache.qpid.framing.FieldTable;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+
public class QpidQueueCreator implements QueueCreator
{
private static final Logger LOGGER = LoggerFactory.getLogger(QpidQueueCreator.class);
private static final FieldTable EMPTY_QUEUE_BIND_ARGUMENTS = new FieldTable();
+ private static final String QUEUE_CREATOR_DRAIN_POLL_TIMEOUT = "qpid.disttest.queue.creator.drainPollTime";
+ private static int _drainPollTimeout = Integer.getInteger(QUEUE_CREATOR_DRAIN_POLL_TIMEOUT, 500);
@Override
- public void createQueues(Session session, List configs)
+ public void createQueues(Connection connection, Session session, List configs)
{
AMQSession, ?> amqSession = (AMQSession, ?>)session;
for (QueueConfig queueConfig : configs)
@@ -44,12 +52,88 @@ public class QpidQueueCreator implements QueueCreator
}
@Override
- public void deleteQueues(Session session, List configs)
+ public void deleteQueues(Connection connection, Session session, List configs)
{
AMQSession, ?> amqSession = (AMQSession, ?>)session;
for (QueueConfig queueConfig : configs)
{
- deleteQueue(amqSession, queueConfig);
+ AMQDestination destination = createAMQDestination(amqSession, queueConfig);
+
+ // drainQueue method is added because deletion of queue with a lot
+ // of messages takes time and might cause the timeout exception
+ drainQueue(connection, destination);
+
+ deleteQueue(amqSession, destination.getAMQQueueName());
+ }
+ }
+
+ private AMQDestination createAMQDestination(AMQSession, ?> amqSession, QueueConfig queueConfig)
+ {
+ try
+ {
+ return (AMQDestination) amqSession.createQueue(queueConfig.getName());
+ }
+ catch (Exception e)
+ {
+ throw new DistributedTestException("Failed to create amq destionation object:" + queueConfig, e);
+ }
+ }
+
+ private long getQueueDepth(AMQSession, ?> amqSession, AMQDestination destination)
+ {
+ try
+ {
+ long queueDepth = amqSession.getQueueDepth(destination);
+ return queueDepth;
+ }
+ catch (Exception e)
+ {
+ throw new DistributedTestException("Failed to query queue depth:" + destination, e);
+ }
+ }
+
+ private void drainQueue(Connection connection, AMQDestination destination)
+ {
+ Session noAckSession = null;
+ try
+ {
+ LOGGER.debug("About to drain the queue {}", destination.getQueueName());
+ noAckSession = connection.createSession(false, org.apache.qpid.jms.Session.NO_ACKNOWLEDGE);
+ MessageConsumer messageConsumer = noAckSession.createConsumer(destination);
+
+ long currentQueueDepth = getQueueDepth((AMQSession,?>)noAckSession, destination);
+ int counter = 0;
+ while (currentQueueDepth > 0)
+ {
+ LOGGER.info("Queue {} has {} message(s)", destination.getQueueName(), currentQueueDepth);
+
+ while(messageConsumer.receive(_drainPollTimeout) != null)
+ {
+ counter++;
+ }
+
+ currentQueueDepth = getQueueDepth((AMQSession,?>)noAckSession, destination);
+ }
+ LOGGER.info("Drained {} message(s) from queue {} ", counter, destination.getQueueName());
+ messageConsumer.close();
+ }
+ catch (Exception e)
+ {
+ throw new DistributedTestException("Failed to drain queue:" + destination, e);
+ }
+ finally
+ {
+ if (noAckSession != null)
+ {
+ try
+ {
+ noAckSession.close();
+ }
+ catch (JMSException e)
+ {
+ throw new DistributedTestException("Failed to close n/a session:" + noAckSession, e);
+ }
+ }
}
}
@@ -66,7 +150,7 @@ public class QpidQueueCreator implements QueueCreator
EMPTY_QUEUE_BIND_ARGUMENTS, destination.getExchangeName(),
destination, autoDelete);
- LOGGER.debug("Created queue " + queueConfig);
+ LOGGER.debug("Created queue {}", queueConfig);
}
catch (Exception e)
{
@@ -74,20 +158,19 @@ public class QpidQueueCreator implements QueueCreator
}
}
- private void deleteQueue(AMQSession, ?> session, QueueConfig queueConfig)
+ private void deleteQueue(AMQSession, ?> session, AMQShortString queueName)
{
try
{
// The Qpid AMQSession API currently makes the #deleteQueue method protected and the
// raw protocol method public. This should be changed then we should switch the below to
// use #deleteQueue.
- AMQDestination destination = (AMQDestination) session.createQueue(queueConfig.getName());
- session.sendQueueDelete(destination.getAMQQueueName());
- LOGGER.debug("Deleted queue " + queueConfig.getName());
+ session.sendQueueDelete(queueName);
+ LOGGER.debug("Deleted queue {}", queueName);
}
catch (Exception e)
{
- throw new DistributedTestException("Failed to delete queue:" + queueConfig.getName(), e);
+ throw new DistributedTestException("Failed to delete queue:" + queueName, e);
}
}
}
diff --git a/java/perftests/src/main/java/org/apache/qpid/disttest/jms/QueueCreator.java b/java/perftests/src/main/java/org/apache/qpid/disttest/jms/QueueCreator.java
index 0947dd53cb..a37cd7888c 100644
--- a/java/perftests/src/main/java/org/apache/qpid/disttest/jms/QueueCreator.java
+++ b/java/perftests/src/main/java/org/apache/qpid/disttest/jms/QueueCreator.java
@@ -20,12 +20,13 @@ package org.apache.qpid.disttest.jms;
import java.util.List;
+import javax.jms.Connection;
import javax.jms.Session;
import org.apache.qpid.disttest.controller.config.QueueConfig;
public interface QueueCreator
{
- public void createQueues(final Session session, final List configs);
- public void deleteQueues(final Session session, final List configs);
+ void createQueues(Connection connection, Session session, List configs);
+ void deleteQueues(Connection connection, Session session, List configs);
}
diff --git a/java/perftests/src/main/java/org/apache/qpid/disttest/message/ConsumerParticipantResult.java b/java/perftests/src/main/java/org/apache/qpid/disttest/message/ConsumerParticipantResult.java
index ad9aa31472..e78f6965d2 100644
--- a/java/perftests/src/main/java/org/apache/qpid/disttest/message/ConsumerParticipantResult.java
+++ b/java/perftests/src/main/java/org/apache/qpid/disttest/message/ConsumerParticipantResult.java
@@ -134,6 +134,7 @@ public class ConsumerParticipantResult extends ParticipantResult
_messageLatencies = messageLatencies;
}
+ @Override
@OutputAttribute(attribute=ParticipantAttribute.MIN_LATENCY)
public long getMinLatency()
{
@@ -145,6 +146,7 @@ public class ConsumerParticipantResult extends ParticipantResult
_minLatency = minLatency;
}
+ @Override
@OutputAttribute(attribute=ParticipantAttribute.MAX_LATENCY)
public long getMaxLatency()
{
@@ -156,6 +158,7 @@ public class ConsumerParticipantResult extends ParticipantResult
_maxLatency = maxLatency;
}
+ @Override
@OutputAttribute(attribute=ParticipantAttribute.AVERAGE_LATENCY)
public double getAverageLatency()
{
@@ -167,6 +170,7 @@ public class ConsumerParticipantResult extends ParticipantResult
_averageLatency = averageLatency;
}
+ @Override
@OutputAttribute(attribute=ParticipantAttribute.LATENCY_STANDARD_DEVIATION)
public double getLatencyStandardDeviation()
{
diff --git a/java/perftests/src/main/java/org/apache/qpid/disttest/message/CreateConsumerCommand.java b/java/perftests/src/main/java/org/apache/qpid/disttest/message/CreateConsumerCommand.java
index 68c21fbf83..07a60504c8 100644
--- a/java/perftests/src/main/java/org/apache/qpid/disttest/message/CreateConsumerCommand.java
+++ b/java/perftests/src/main/java/org/apache/qpid/disttest/message/CreateConsumerCommand.java
@@ -21,7 +21,6 @@ package org.apache.qpid.disttest.message;
public class CreateConsumerCommand extends CreateParticpantCommand
{
- private boolean _isTopic;
private boolean _isDurableSubscription;
private boolean _isBrowsingSubscription;
private String _selector;
@@ -75,16 +74,6 @@ public class CreateConsumerCommand extends CreateParticpantCommand
this._noLocal = noLocal;
}
- public boolean isTopic()
- {
- return _isTopic;
- }
-
- public void setTopic(boolean isTopic)
- {
- this._isTopic = isTopic;
- }
-
public boolean isSynchronous()
{
return _synchronous;
diff --git a/java/perftests/src/main/java/org/apache/qpid/disttest/message/CreateParticpantCommand.java b/java/perftests/src/main/java/org/apache/qpid/disttest/message/CreateParticpantCommand.java
index b1caa6ef75..e7349bf795 100644
--- a/java/perftests/src/main/java/org/apache/qpid/disttest/message/CreateParticpantCommand.java
+++ b/java/perftests/src/main/java/org/apache/qpid/disttest/message/CreateParticpantCommand.java
@@ -23,6 +23,7 @@ import org.apache.commons.lang.builder.ToStringBuilder;
public abstract class CreateParticpantCommand extends Command
{
+ private boolean _isTopic;
private String _participantName;
private String _sessionName;
private String _destinationName;
@@ -65,6 +66,16 @@ public abstract class CreateParticpantCommand extends Command
_destinationName = destinationName;
}
+ public boolean isTopic()
+ {
+ return _isTopic;
+ }
+
+ public void setTopic(boolean isTopic)
+ {
+ _isTopic = isTopic;
+ }
+
public long getNumberOfMessages()
{
return _numberOfMessages;
diff --git a/java/perftests/src/main/java/org/apache/qpid/disttest/message/ParticipantAttribute.java b/java/perftests/src/main/java/org/apache/qpid/disttest/message/ParticipantAttribute.java
index 0418562a2d..1154ff306c 100644
--- a/java/perftests/src/main/java/org/apache/qpid/disttest/message/ParticipantAttribute.java
+++ b/java/perftests/src/main/java/org/apache/qpid/disttest/message/ParticipantAttribute.java
@@ -18,6 +18,8 @@
*/
package org.apache.qpid.disttest.message;
+import java.text.DecimalFormat;
+
import org.apache.qpid.disttest.client.Participant;
/**
@@ -31,6 +33,8 @@ public enum ParticipantAttribute
{
TEST_NAME("testName"),
ITERATION_NUMBER("iterationNumber"),
+ THROUGHPUT("throughputKbPerS", "#"),
+ AVERAGE_LATENCY("averageLatency", "#"),
CONFIGURED_CLIENT_NAME("clientName"),
PARTICIPANT_NAME("participantName"),
NUMBER_OF_MESSAGES_PROCESSED("numberOfMessages"),
@@ -52,24 +56,56 @@ public enum ParticipantAttribute
TOTAL_NUMBER_OF_CONSUMERS("totalNumberOfConsumers"),
TOTAL_NUMBER_OF_PRODUCERS("totalNumberOfProducers"),
TOTAL_PAYLOAD_PROCESSED("totalPayloadProcessedB"),
- THROUGHPUT("throughputKbPerS"),
TIME_TAKEN("timeTakenMs"),
ERROR_MESSAGE("errorMessage"),
MIN_LATENCY("minLatency"),
MAX_LATENCY("maxLatency"),
- AVERAGE_LATENCY("averageLatency"),
- LATENCY_STANDARD_DEVIATION("latencyStandardDeviation")
+ LATENCY_STANDARD_DEVIATION("latencyStandardDeviation"),
+ MESSAGE_THROUGHPUT("throughputMessagesPerS")
;
private String _displayName;
+ private String _decimalFormat;
ParticipantAttribute(String displayName)
{
_displayName = displayName;
}
+ ParticipantAttribute(String displayName, String decimalFormat)
+ {
+ _displayName = displayName;
+ _decimalFormat = decimalFormat;
+ }
+
+ public String getDecimalFormat()
+ {
+ return _decimalFormat;
+ }
+
public String getDisplayName()
{
return _displayName;
}
+
+ public String format(Object attributeValue)
+ {
+ if(attributeValue == null)
+ {
+ return null;
+ }
+
+ String attributeAsString = String.valueOf(attributeValue);
+
+ if(_decimalFormat != null)
+ {
+ DecimalFormat decimalFormat = new DecimalFormat(_decimalFormat);
+ double attributeAsDoule = Double.valueOf(attributeAsString);
+ return decimalFormat.format(attributeAsDoule);
+ }
+ else
+ {
+ return attributeAsString;
+ }
+ }
}
diff --git a/java/perftests/src/main/java/org/apache/qpid/disttest/message/ParticipantResult.java b/java/perftests/src/main/java/org/apache/qpid/disttest/message/ParticipantResult.java
index a6d3d91bae..0a824a316b 100644
--- a/java/perftests/src/main/java/org/apache/qpid/disttest/message/ParticipantResult.java
+++ b/java/perftests/src/main/java/org/apache/qpid/disttest/message/ParticipantResult.java
@@ -22,11 +22,12 @@ import static org.apache.qpid.disttest.message.ParticipantAttribute.BATCH_SIZE;
import static org.apache.qpid.disttest.message.ParticipantAttribute.CONFIGURED_CLIENT_NAME;
import static org.apache.qpid.disttest.message.ParticipantAttribute.ITERATION_NUMBER;
import static org.apache.qpid.disttest.message.ParticipantAttribute.MAXIMUM_DURATION;
-import static org.apache.qpid.disttest.message.ParticipantAttribute.PAYLOAD_SIZE;
+import static org.apache.qpid.disttest.message.ParticipantAttribute.MESSAGE_THROUGHPUT;
import static org.apache.qpid.disttest.message.ParticipantAttribute.NUMBER_OF_MESSAGES_PROCESSED;
-import static org.apache.qpid.disttest.message.ParticipantAttribute.THROUGHPUT;
import static org.apache.qpid.disttest.message.ParticipantAttribute.PARTICIPANT_NAME;
+import static org.apache.qpid.disttest.message.ParticipantAttribute.PAYLOAD_SIZE;
import static org.apache.qpid.disttest.message.ParticipantAttribute.TEST_NAME;
+import static org.apache.qpid.disttest.message.ParticipantAttribute.THROUGHPUT;
import java.util.Comparator;
import java.util.Date;
@@ -49,6 +50,7 @@ public class ParticipantResult extends Response
private long _totalPayloadProcessed;
private int _payloadSize;
private double _throughput;
+ private int _messageThroughput;
private int _totalNumberOfConsumers;
private int _totalNumberOfProducers;
@@ -236,6 +238,17 @@ public class ParticipantResult extends Response
_throughput = throughput;
}
+ @OutputAttribute(attribute=MESSAGE_THROUGHPUT)
+ public int getMessageThroughput()
+ {
+ return _messageThroughput;
+ }
+
+ public void setMessageThroughput(int throughput)
+ {
+ _messageThroughput = throughput;
+ }
+
public void setTotalNumberOfConsumers(int totalNumberOfConsumers)
{
_totalNumberOfConsumers = totalNumberOfConsumers;
@@ -269,4 +282,41 @@ public class ParticipantResult extends Response
_acknowledgeMode = acknowledgeMode;
}
+ public double getLatencyStandardDeviation()
+ {
+ return 0.0;
+ }
+
+ @OutputAttribute(attribute = ParticipantAttribute.MIN_LATENCY)
+ public long getMinLatency()
+ {
+ return 0;
+ }
+
+ @OutputAttribute(attribute = ParticipantAttribute.MAX_LATENCY)
+ public long getMaxLatency()
+ {
+ return 0;
+ }
+
+ @OutputAttribute(attribute = ParticipantAttribute.AVERAGE_LATENCY)
+ public double getAverageLatency()
+ {
+ return 0;
+ }
+
+ public int getPriority()
+ {
+ return 0;
+ }
+
+ public long getTimeToLive()
+ {
+ return 0;
+ }
+
+ public int getDeliveryMode()
+ {
+ return 0;
+ }
}
diff --git a/java/perftests/src/main/java/org/apache/qpid/disttest/message/ProducerParticipantResult.java b/java/perftests/src/main/java/org/apache/qpid/disttest/message/ProducerParticipantResult.java
index 766c90eec8..2d9399a3d3 100644
--- a/java/perftests/src/main/java/org/apache/qpid/disttest/message/ProducerParticipantResult.java
+++ b/java/perftests/src/main/java/org/apache/qpid/disttest/message/ProducerParticipantResult.java
@@ -42,6 +42,7 @@ public class ProducerParticipantResult extends ParticipantResult
setParticipantName(participantName);
}
+ @Override
@OutputAttribute(attribute=PRIORITY)
public int getPriority()
{
@@ -53,6 +54,7 @@ public class ProducerParticipantResult extends ParticipantResult
_priority = priority;
}
+ @Override
@OutputAttribute(attribute=TIME_TO_LIVE)
public long getTimeToLive()
{
@@ -86,6 +88,7 @@ public class ProducerParticipantResult extends ParticipantResult
_interval = producerInterval;
}
+ @Override
@OutputAttribute(attribute=DELIVERY_MODE)
public int getDeliveryMode()
{
@@ -96,5 +99,4 @@ public class ProducerParticipantResult extends ParticipantResult
{
this._deliveryMode = deliveryMode;
}
-
}
diff --git a/java/perftests/src/main/java/org/apache/qpid/disttest/results/aggregation/ITestResult.java b/java/perftests/src/main/java/org/apache/qpid/disttest/results/aggregation/ITestResult.java
index 3f9cdff69d..6230067486 100644
--- a/java/perftests/src/main/java/org/apache/qpid/disttest/results/aggregation/ITestResult.java
+++ b/java/perftests/src/main/java/org/apache/qpid/disttest/results/aggregation/ITestResult.java
@@ -22,10 +22,8 @@ import java.util.List;
import org.apache.qpid.disttest.message.ParticipantResult;
-// TODO rename me!!
public interface ITestResult
{
-
// TODO should weaken to Collection
List getParticipantResults();
diff --git a/java/perftests/src/main/java/org/apache/qpid/disttest/results/aggregation/ParticipantResultAggregator.java b/java/perftests/src/main/java/org/apache/qpid/disttest/results/aggregation/ParticipantResultAggregator.java
index 4dcabe6c7b..c21a78d359 100644
--- a/java/perftests/src/main/java/org/apache/qpid/disttest/results/aggregation/ParticipantResultAggregator.java
+++ b/java/perftests/src/main/java/org/apache/qpid/disttest/results/aggregation/ParticipantResultAggregator.java
@@ -142,6 +142,7 @@ public class ParticipantResultAggregator
aggregatedResult.setStartDate(new Date(_minStartDate));
aggregatedResult.setEndDate(new Date(_maxEndDate));
aggregatedResult.setThroughput(calculateThroughputInKiloBytesPerSecond());
+ aggregatedResult.setMessageThroughput(calculateThroughputInMessagesPerSecond());
}
private void setRolledUpConstantAttributes(ParticipantResult aggregatedResult)
@@ -197,4 +198,14 @@ public class ParticipantResultAggregator
return totalPayloadProcessedInKiloBytes/durationInSeconds;
}
+ private int calculateThroughputInMessagesPerSecond()
+ {
+ double durationInMillis = _maxEndDate - _minStartDate;
+ if (durationInMillis == 0 )
+ {
+ return 0;
+ }
+
+ return (int)Math.round((_numberOfMessagesProcessed * 1000.0d)/durationInMillis);
+ }
}
diff --git a/java/perftests/src/main/java/org/apache/qpid/disttest/results/aggregation/TestResultAggregator.java b/java/perftests/src/main/java/org/apache/qpid/disttest/results/aggregation/TestResultAggregator.java
index 5934e0e997..954828b043 100644
--- a/java/perftests/src/main/java/org/apache/qpid/disttest/results/aggregation/TestResultAggregator.java
+++ b/java/perftests/src/main/java/org/apache/qpid/disttest/results/aggregation/TestResultAggregator.java
@@ -18,6 +18,9 @@
*/
package org.apache.qpid.disttest.results.aggregation;
+import java.util.List;
+
+import org.apache.qpid.disttest.controller.ResultsForAllTests;
import org.apache.qpid.disttest.message.ConsumerParticipantResult;
import org.apache.qpid.disttest.message.ParticipantResult;
import org.apache.qpid.disttest.message.ProducerParticipantResult;
@@ -102,5 +105,26 @@ public class TestResultAggregator
aggregatedAllResult.setNumberOfMessagesProcessed(aggregatedConsumerResult.getNumberOfMessagesProcessed());
aggregatedAllResult.setTotalPayloadProcessed(aggregatedConsumerResult.getTotalPayloadProcessed());
aggregatedAllResult.setThroughput(aggregatedConsumerResult.getThroughput());
+ aggregatedAllResult.setMessageThroughput(aggregatedConsumerResult.getMessageThroughput());
+ }
+
+ /**
+ * Produces a single {@link ResultsForAllTests} from the supplied list, only containing
+ * the "All participants" results.
+ */
+ public ResultsForAllTests aggregateTestResults(List allResultsList)
+ {
+ ResultsForAllTests retVal = new ResultsForAllTests();
+
+ for (ResultsForAllTests resultsForAllTests : allResultsList)
+ {
+ ResultsForAllTests allParticipantsResult = resultsForAllTests.getAllParticipantsResult();
+ for (ITestResult testResult : allParticipantsResult.getTestResults())
+ {
+ retVal.add(testResult);
+ }
+ }
+
+ return retVal;
}
}
diff --git a/java/perftests/src/main/java/org/apache/qpid/disttest/results/formatting/CSVFormater.java b/java/perftests/src/main/java/org/apache/qpid/disttest/results/formatting/CSVFormater.java
deleted file mode 100644
index 52e53ca624..0000000000
--- a/java/perftests/src/main/java/org/apache/qpid/disttest/results/formatting/CSVFormater.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * 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.
- */
-package org.apache.qpid.disttest.results.formatting;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.commons.lang.StringUtils;
-import org.apache.qpid.disttest.controller.ResultsForAllTests;
-import org.apache.qpid.disttest.message.ParticipantAttribute;
-import org.apache.qpid.disttest.message.ParticipantResult;
-import org.apache.qpid.disttest.results.aggregation.ITestResult;
-
-/**
- * produces CSV output using the ordered enums in {@link ParticipantAttribute}
- */
-public class CSVFormater
-{
- public String format(ResultsForAllTests results)
- {
- StringBuilder builder = new StringBuilder();
-
- builder.append(header());
-
- List testResults = results.getTestResults();
-
- for (ITestResult testResult : testResults)
- {
-
- List participantResults = new ArrayList(testResult.getParticipantResults());
- Collections.sort(participantResults, new CSVOrderParticipantResultComparator());
-
- for (ParticipantResult participantResult : participantResults)
- {
- Map attributes = participantResult.getAttributes();
- builder.append(row(attributes));
- }
- }
-
- return builder.toString();
- }
-
- /**
- * return a row, including a newline character at the end
- */
- private String row(Map attributeValueMap)
- {
- List
*
- *
chart-defs=directory contain chartdef file(s)
- *
output-dir=directory in which to produce the PNGs
+ *
{@link #OUTPUT_DIR_PROP}
+ *
{@link #CHART_DEFINITIONS_PROP}
+ *
{@link #SUMMARY_TITLE_PROP}
+ *
{@link #JDBC_DRIVER_NAME_PROP}
+ *
{@link #JDBC_URL_PROP}
*
+ * Default values are indicated by the similarly named constants in this class.
*/
public class ChartingUtil
{
private static final Logger LOGGER = LoggerFactory.getLogger(ChartingUtil.class);
+ /** directory in which to produce the PNGs */
public static final String OUTPUT_DIR_PROP = "outputdir";
public static final String OUTPUT_DIR_DEFAULT = ".";
+ /** the path to the directory containing the chart definition files */
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";
+
+ /** the class name of the JDBC driver to use for reading the chart data */
+ public static final String JDBC_DRIVER_NAME_PROP = "jdbcDriverClass";
+ public static final String JDBC_DRIVER_NAME_DEFAULT = JdbcUrlGenerator.DEFAULT_JDBC_DRIVER_NAME;
+
+ /** the JDBC URL of the data to be charted */
+ public static final String JDBC_URL_PROP = "jdbcUrl";
+ public static final String JDBC_URL_DEFAULT = null;
+
+
private Map _cliOptions = new HashMap();
+
{
_cliOptions.put(OUTPUT_DIR_PROP, OUTPUT_DIR_DEFAULT);
_cliOptions.put(CHART_DEFINITIONS_PROP, CHART_DEFINITIONS_DEFAULT);
+ _cliOptions.put(SUMMARY_TITLE_PROP, SUMMARY_TITLE_DEFAULT);
+ _cliOptions.put(JDBC_DRIVER_NAME_PROP, JDBC_DRIVER_NAME_DEFAULT);
+ _cliOptions.put(JDBC_URL_PROP, JDBC_URL_DEFAULT);
}
public static void main(String[] args) throws Exception
@@ -82,26 +105,38 @@ public class ChartingUtil
private void produceAllCharts()
{
- final String chartingDefsDir = _cliOptions.get(CHART_DEFINITIONS_PROP);
- final File chartDirectory = new File(_cliOptions.get(OUTPUT_DIR_PROP));
- LOGGER.info("Chart chartdef directory/file: {} output directory : {}", chartingDefsDir, chartDirectory);
-
- List definitions = loadChartDefinitions(chartingDefsDir);
-
- LOGGER.info("There are {} chart(s) to produce", definitions.size());
final ChartWriter writer = new ChartWriter();
- writer.setOutputDirectory(chartDirectory);
+ writer.setOutputDirectory(new File(_cliOptions.get(OUTPUT_DIR_PROP)));
+
+ SeriesBuilder seriesBuilder = new JdbcSeriesBuilder(
+ _cliOptions.get(JDBC_DRIVER_NAME_PROP),
+ _cliOptions.get(JDBC_URL_PROP));
- final SeriesBuilder seriesBuilder = new JdbcCsvSeriesBuilder();
- for (ChartingDefinition chartingDefinition : definitions)
+ for (ChartingDefinition chartingDefinition : loadChartDefinitions())
{
- ChartBuilder chartBuilder = ChartBuilderFactory.createChartBuilder(chartingDefinition.getChartType(), seriesBuilder);
+ ChartBuilder chartBuilder = ChartBuilderFactory.createChartBuilder(
+ chartingDefinition.getChartType(),
+ seriesBuilder);
+
JFreeChart chart = chartBuilder.buildChart(chartingDefinition);
- writer.writeChartToFileSystem(chart, chartingDefinition.getChartStemName());
+ writer.writeChartToFileSystem(chart, chartingDefinition);
}
- writer.writeHtmlSummaryToFileSystem();
+ final String summaryChartTitle = _cliOptions.get(SUMMARY_TITLE_PROP);
+ writer.writeHtmlSummaryToFileSystem(summaryChartTitle);
+ }
+
+ private List loadChartDefinitions()
+ {
+ final String chartingDefsDir = _cliOptions.get(CHART_DEFINITIONS_PROP);
+
+ LOGGER.info("Chart chartdef directory/file: {}", chartingDefsDir);
+
+ List definitions = loadChartDefinitions(chartingDefsDir);
+
+ LOGGER.info("There are {} chart(s) to produce", definitions.size());
+ return definitions;
}
private List loadChartDefinitions(String chartingDefsDir)
diff --git a/java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/chartbuilder/BarChart3DBuilder.java b/java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/chartbuilder/BarChart3DBuilder.java
index 491bb1c67d..b10fd477ed 100644
--- a/java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/chartbuilder/BarChart3DBuilder.java
+++ b/java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/chartbuilder/BarChart3DBuilder.java
@@ -36,7 +36,7 @@ public class BarChart3DBuilder extends CategoryDataSetBasedChartBuilder
}
@Override
- public JFreeChart createChartImpl(String title, String xAxisTitle,
+ protected JFreeChart createCategoryChart(String title, String xAxisTitle,
String yAxisTitle, final Dataset dataset, PlotOrientation plotOrientation,
boolean showLegend, boolean showToolTips, boolean showUrls)
{
diff --git a/java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/chartbuilder/BarChartBuilder.java b/java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/chartbuilder/BarChartBuilder.java
index b5c6a38067..7705ef5d3a 100644
--- a/java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/chartbuilder/BarChartBuilder.java
+++ b/java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/chartbuilder/BarChartBuilder.java
@@ -35,7 +35,7 @@ public class BarChartBuilder extends CategoryDataSetBasedChartBuilder
}
@Override
- public JFreeChart createChartImpl(String title, String xAxisTitle,
+ protected JFreeChart createCategoryChart(String title, String xAxisTitle,
String yAxisTitle, final Dataset dataset, PlotOrientation plotOrientation,
boolean showLegend, boolean showToolTips, boolean showUrls)
{
diff --git a/java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/chartbuilder/BaseChartBuilder.java b/java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/chartbuilder/BaseChartBuilder.java
index def87f5840..9cadf0ec3c 100644
--- a/java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/chartbuilder/BaseChartBuilder.java
+++ b/java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/chartbuilder/BaseChartBuilder.java
@@ -23,6 +23,9 @@ import java.awt.Color;
import java.awt.GradientPaint;
import org.apache.qpid.disttest.charting.definition.ChartingDefinition;
+import org.apache.qpid.disttest.charting.seriesbuilder.DatasetHolder;
+import org.apache.qpid.disttest.charting.seriesbuilder.SeriesBuilder;
+import org.jfree.chart.ChartFactory;
import org.jfree.chart.JFreeChart;
import org.jfree.chart.plot.PlotOrientation;
import org.jfree.chart.title.ShortTextTitle;
@@ -30,12 +33,67 @@ import org.jfree.data.general.Dataset;
public abstract class BaseChartBuilder implements ChartBuilder
{
- private static final GradientPaint BLUE_GRADIENT = new GradientPaint(0, 0, Color.white, 0, 1000, Color.blue);
+ static final GradientPaint BLUE_GRADIENT = new GradientPaint(0, 0, Color.white, 0, 1000, Color.blue);
- public void addCommonChartAttributes(JFreeChart chart, ChartingDefinition chartingDefinition)
+ private SeriesPainter _seriesPainter = new SeriesPainter();
+
+ private final SeriesBuilder _seriesBuilder;
+
+ protected BaseChartBuilder(SeriesBuilder seriesBuilder)
+ {
+ _seriesBuilder = seriesBuilder;
+ }
+
+ @Override
+ public JFreeChart buildChart(ChartingDefinition chartingDefinition)
+ {
+ _seriesBuilder.setDatasetHolder(newDatasetHolder());
+ Dataset dataset = _seriesBuilder.build(chartingDefinition.getSeriesDefinitions());
+
+ JFreeChart chart = createChart(chartingDefinition, dataset);
+ return chart;
+ }
+
+
+ /**
+ * return a holder of an empty dataset suitable for use with the chart type
+ * returned by {@link #createChartImpl(String, String, String, Dataset, PlotOrientation, boolean, boolean, boolean)}.
+ */
+ protected abstract DatasetHolder newDatasetHolder();
+
+ /**
+ * Create a chart with the supplied parameters.
+ *
+ * For ease of implementation, the signature is intentionally similar
+ * to {@link ChartFactory}'s factory methods.
+ */
+ protected abstract JFreeChart createChartImpl(
+ String title, String xAxisTitle, String yAxisTitle,
+ final Dataset dataset,
+ PlotOrientation plotOrientation, boolean showLegend, boolean showToolTips, boolean showUrls);
+
+ /**
+ * Create a {@link SeriesStrokeAndPaintApplier} that will be used to format a chart
+ */
+ protected abstract SeriesStrokeAndPaintApplier newStrokeAndPaintApplier();
+
+
+ private JFreeChart createChart(ChartingDefinition chartingDefinition, final Dataset dataset)
{
+ String title = chartingDefinition.getChartTitle();
+ String xAxisTitle = chartingDefinition.getXAxisTitle();
+ String yAxisTitle = chartingDefinition.getYAxisTitle();
+
+ final JFreeChart chart = createChartImpl(
+ title, xAxisTitle, yAxisTitle,
+ dataset,
+ PLOT_ORIENTATION, SHOW_LEGEND, SHOW_TOOL_TIPS, SHOW_URLS);
+
addSubtitle(chart, chartingDefinition);
- setBackgroundColour(chart);
+ chart.setBackgroundPaint(BLUE_GRADIENT);
+ _seriesPainter.applySeriesAppearance(chart, chartingDefinition.getSeriesDefinitions(), newStrokeAndPaintApplier());
+
+ return chart;
}
private void addSubtitle(JFreeChart chart, ChartingDefinition chartingDefinition)
@@ -46,13 +104,9 @@ public abstract class BaseChartBuilder implements ChartBuilder
}
}
- private void setBackgroundColour(JFreeChart chart)
+ void setSeriesPainter(SeriesPainter seriesPainter)
{
- chart.setBackgroundPaint(BLUE_GRADIENT);
+ _seriesPainter = seriesPainter;
}
- public abstract JFreeChart createChartImpl(String title, String xAxisTitle,
- String yAxisTitle, final Dataset dataset, PlotOrientation plotOrientation, boolean showLegend, boolean showToolTips,
- boolean showUrls);
-
}
diff --git a/java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/chartbuilder/CategoryDataSetBasedChartBuilder.java b/java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/chartbuilder/CategoryDataSetBasedChartBuilder.java
index a6c63f4560..0d08fd8ad1 100644
--- a/java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/chartbuilder/CategoryDataSetBasedChartBuilder.java
+++ b/java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/chartbuilder/CategoryDataSetBasedChartBuilder.java
@@ -20,40 +20,36 @@
package org.apache.qpid.disttest.charting.chartbuilder;
-import org.apache.qpid.disttest.charting.definition.ChartingDefinition;
import org.apache.qpid.disttest.charting.definition.SeriesDefinition;
-import org.apache.qpid.disttest.charting.seriesbuilder.SeriesBuilderCallback;
+import org.apache.qpid.disttest.charting.seriesbuilder.DatasetHolder;
import org.apache.qpid.disttest.charting.seriesbuilder.SeriesBuilder;
+import org.apache.qpid.disttest.charting.seriesbuilder.SeriesRow;
import org.jfree.chart.JFreeChart;
import org.jfree.chart.axis.CategoryLabelPositions;
+import org.jfree.chart.plot.PlotOrientation;
import org.jfree.data.category.DefaultCategoryDataset;
+import org.jfree.data.general.Dataset;
public abstract class CategoryDataSetBasedChartBuilder extends BaseChartBuilder
{
- private final SeriesBuilder _seriesBuilder;
-
public CategoryDataSetBasedChartBuilder(SeriesBuilder seriesBuilder)
{
- _seriesBuilder = seriesBuilder;
+ super(seriesBuilder);
}
@Override
- public JFreeChart buildChart(ChartingDefinition chartingDefinition)
+ protected DatasetHolder newDatasetHolder()
{
- String title = chartingDefinition.getChartTitle();
- String xAxisTitle = chartingDefinition.getXAxisTitle();
- String yAxisTitle = chartingDefinition.getYAxisTitle();
-
- final DefaultCategoryDataset dataset = new DefaultCategoryDataset();
-
- _seriesBuilder.setSeriesBuilderCallback(new SeriesBuilderCallback()
+ return new DatasetHolder()
{
+ final private DefaultCategoryDataset _dataset = new DefaultCategoryDataset();
+
@Override
- public void addDataPointToSeries(SeriesDefinition seriesDefinition, Object[] row)
+ public void addDataPointToSeries(SeriesDefinition seriesDefinition, SeriesRow row)
{
- String x = String.valueOf(row[0]);
- double y = Double.parseDouble(row[1].toString());
- dataset.addValue( y, seriesDefinition.getSeriesLegend(), x);
+ String x = row.dimensionAsString(0);
+ double y = row.dimensionAsDouble(1);
+ _dataset.addValue(y, seriesDefinition.getSeriesLegend(), x);
}
@Override
@@ -68,17 +64,33 @@ public abstract class CategoryDataSetBasedChartBuilder extends BaseChartBuilder
// unused
}
- });
+ @Override
+ public int getNumberOfDimensions()
+ {
+ return 2;
+ }
- _seriesBuilder.build(chartingDefinition.getSeries());
+ @Override
+ public Dataset getPopulatedDataset()
+ {
+ return _dataset;
+ }
+ };
+ }
- JFreeChart chart = createChartImpl(title, xAxisTitle, yAxisTitle,
- dataset, PLOT_ORIENTATION, SHOW_LEGEND, SHOW_TOOL_TIPS, SHOW_URLS);
+ @Override
+ protected SeriesStrokeAndPaintApplier newStrokeAndPaintApplier()
+ {
+ return new CategoryStrokeAndPaintApplier();
+ }
+ @Override
+ protected final JFreeChart createChartImpl(String title, String xAxisTitle, String yAxisTitle, Dataset dataset, PlotOrientation plotOrientation, boolean showLegend, boolean showToolTips, boolean showUrls)
+ {
+ JFreeChart chart = createCategoryChart(title, xAxisTitle, yAxisTitle, dataset, plotOrientation, showLegend, showToolTips, showUrls);
chart.getCategoryPlot().getDomainAxis().setCategoryLabelPositions(CategoryLabelPositions.UP_45);
-
- addCommonChartAttributes(chart, chartingDefinition);
-
return chart;
}
+
+ protected abstract JFreeChart createCategoryChart(String title, String xAxisTitle, String yAxisTitle, Dataset dataset, PlotOrientation plotOrientation, boolean showLegend, boolean showToolTips, boolean showUrls);
}
diff --git a/java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/chartbuilder/CategoryStrokeAndPaintApplier.java b/java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/chartbuilder/CategoryStrokeAndPaintApplier.java
new file mode 100644
index 0000000000..cbf5cbe515
--- /dev/null
+++ b/java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/chartbuilder/CategoryStrokeAndPaintApplier.java
@@ -0,0 +1,41 @@
+/*
+ *
+ * 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.
+ *
+ */
+package org.apache.qpid.disttest.charting.chartbuilder;
+
+import java.awt.Color;
+import java.awt.Stroke;
+
+import org.jfree.chart.JFreeChart;
+
+class CategoryStrokeAndPaintApplier implements SeriesStrokeAndPaintApplier
+{
+ @Override
+ public void setSeriesStroke(int seriesIndex, Stroke stroke, JFreeChart targetChart)
+ {
+ targetChart.getCategoryPlot().getRenderer().setSeriesStroke(seriesIndex, stroke);
+ }
+
+ @Override
+ public void setSeriesPaint(int seriesIndex, Color colour, JFreeChart targetChart)
+ {
+ targetChart.getCategoryPlot().getRenderer().setSeriesPaint(seriesIndex, colour);
+ }
+}
\ No newline at end of file
diff --git a/java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/chartbuilder/ChartBuilderFactory.java b/java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/chartbuilder/ChartBuilderFactory.java
index f4e11a2c4d..63a0573676 100644
--- a/java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/chartbuilder/ChartBuilderFactory.java
+++ b/java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/chartbuilder/ChartBuilderFactory.java
@@ -39,8 +39,10 @@ public class ChartBuilderFactory
return new BarChart3DBuilder(seriesBuilder);
case XYLINE:
return new XYLineChartBuilder(seriesBuilder);
+ case TIMELINE:
+ return new TimeSeriesLineChartBuilder(seriesBuilder);
case STATISTICAL_BAR:
- return new StatisticalBarCharBuilder(seriesBuilder);
+ return new StatisticalBarChartBuilder(seriesBuilder);
default:
throw new IllegalArgumentException("Unknown chart type " + chartType);
}
diff --git a/java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/chartbuilder/ColorFactory.java b/java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/chartbuilder/ColorFactory.java
new file mode 100644
index 0000000000..49d777c506
--- /dev/null
+++ b/java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/chartbuilder/ColorFactory.java
@@ -0,0 +1,66 @@
+/*
+ * 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.
+ *
+ */
+package org.apache.qpid.disttest.charting.chartbuilder;
+
+import java.awt.Color;
+
+public class ColorFactory
+{
+ /**
+ * Converts a colour name known to the JDK into a {@link Color} instance. Additionally,
+ * if the work dark_ is prepended to the colour, a darker shade of the same colour is
+ * produced.
+ *
+ * @param colourName
+ * @return colour instance
+ */
+ public static Color toColour(String colourName)
+ {
+ boolean darkVersion = false;
+ if (colourName.toLowerCase().startsWith("dark_"))
+ {
+ colourName = colourName.replaceFirst("(?i)dark_", "");
+ darkVersion = true;
+ }
+
+ Color colour = getColourFromStaticField(colourName);
+ if (darkVersion)
+ {
+ return colour.darker();
+ }
+ else
+ {
+ return colour;
+ }
+ }
+
+ private static Color getColourFromStaticField(String colourName)
+ {
+ try
+ {
+ return (Color) Color.class.getField(colourName.toLowerCase()).get(null);
+ }
+ catch (Exception e)
+ {
+ throw new RuntimeException("Could not find colour for " + colourName, e);
+ }
+ }
+
+}
diff --git a/java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/chartbuilder/LineChart3DBuilder.java b/java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/chartbuilder/LineChart3DBuilder.java
index 27fff12da0..b92a25f5ac 100644
--- a/java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/chartbuilder/LineChart3DBuilder.java
+++ b/java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/chartbuilder/LineChart3DBuilder.java
@@ -34,7 +34,7 @@ public class LineChart3DBuilder extends CategoryDataSetBasedChartBuilder
}
@Override
- public JFreeChart createChartImpl(String title, String xAxisTitle,
+ protected JFreeChart createCategoryChart(String title, String xAxisTitle,
String yAxisTitle, final Dataset dataset, PlotOrientation plotOrientation,
boolean showLegend, boolean showToolTips, boolean showUrls)
{
diff --git a/java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/chartbuilder/LineChartBuilder.java b/java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/chartbuilder/LineChartBuilder.java
index 40f3a09b6b..3f5b18acda 100644
--- a/java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/chartbuilder/LineChartBuilder.java
+++ b/java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/chartbuilder/LineChartBuilder.java
@@ -35,7 +35,7 @@ public class LineChartBuilder extends CategoryDataSetBasedChartBuilder
}
@Override
- public JFreeChart createChartImpl(String title, String xAxisTitle,
+ protected JFreeChart createCategoryChart(String title, String xAxisTitle,
String yAxisTitle, final Dataset dataset, PlotOrientation plotOrientation,
boolean showLegend, boolean showToolTips, boolean showUrls)
{
diff --git a/java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/chartbuilder/SeriesPainter.java b/java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/chartbuilder/SeriesPainter.java
new file mode 100644
index 0000000000..854635dc87
--- /dev/null
+++ b/java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/chartbuilder/SeriesPainter.java
@@ -0,0 +1,63 @@
+/*
+ * 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.
+ *
+ */
+package org.apache.qpid.disttest.charting.chartbuilder;
+
+import java.awt.BasicStroke;
+import java.util.List;
+
+import org.apache.qpid.disttest.charting.definition.SeriesDefinition;
+import org.jfree.chart.JFreeChart;
+
+public class SeriesPainter
+{
+ public void applySeriesAppearance(JFreeChart chart, List seriesDefinitions, SeriesStrokeAndPaintApplier strokeAndPaintApplier)
+ {
+ for (int i = 0; i < seriesDefinitions.size(); i++)
+ {
+ SeriesDefinition seriesDefinition = seriesDefinitions.get(i);
+ if (seriesDefinition.getSeriesColourName() != null)
+ {
+ strokeAndPaintApplier.setSeriesPaint(i, ColorFactory.toColour(seriesDefinition.getSeriesColourName()), chart);
+ }
+ if (seriesDefinition.getStrokeWidth() != null)
+ {
+ // Negative width used to signify dashed
+ boolean dashed = seriesDefinition.getStrokeWidth() < 0;
+ float width = Math.abs(seriesDefinition.getStrokeWidth());
+ BasicStroke stroke = buildStrokeOfWidth(width, dashed);
+ strokeAndPaintApplier.setSeriesStroke(i, stroke, chart);
+ }
+ }
+ }
+
+ private BasicStroke buildStrokeOfWidth(float width, boolean dashed)
+ {
+ final BasicStroke stroke;
+ if (dashed)
+ {
+ stroke = new BasicStroke(width, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND, 1.0f, new float[] {5.0f, 3.0f}, 0.0f);
+ }
+ else
+ {
+ stroke = new BasicStroke(width, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND);
+ }
+ return stroke;
+ }
+}
diff --git a/java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/chartbuilder/SeriesStrokeAndPaintApplier.java b/java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/chartbuilder/SeriesStrokeAndPaintApplier.java
new file mode 100644
index 0000000000..4d6c37a9f4
--- /dev/null
+++ b/java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/chartbuilder/SeriesStrokeAndPaintApplier.java
@@ -0,0 +1,35 @@
+/*
+ * 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.
+ *
+ */
+package org.apache.qpid.disttest.charting.chartbuilder;
+
+import java.awt.Color;
+import java.awt.Stroke;
+
+import org.jfree.chart.JFreeChart;
+
+/**
+ * Applies the supplied stroke and color to a series in the target chart.
+ * Multiple implementations exist to because of the various chart types.
+ */
+public interface SeriesStrokeAndPaintApplier
+{
+ void setSeriesStroke(int seriesIndex, Stroke stroke, JFreeChart targetChart);
+ void setSeriesPaint(int seriesIndex, Color color, JFreeChart targetChart);
+}
diff --git a/java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/chartbuilder/StatisticalBarCharBuilder.java b/java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/chartbuilder/StatisticalBarCharBuilder.java
deleted file mode 100644
index 86c3f62e09..0000000000
--- a/java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/chartbuilder/StatisticalBarCharBuilder.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- *
- * 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.
- *
- */
-package org.apache.qpid.disttest.charting.chartbuilder;
-
-import java.awt.Font;
-
-import org.apache.qpid.disttest.charting.definition.ChartingDefinition;
-import org.apache.qpid.disttest.charting.definition.SeriesDefinition;
-import org.apache.qpid.disttest.charting.seriesbuilder.SeriesBuilder;
-import org.apache.qpid.disttest.charting.seriesbuilder.SeriesBuilderCallback;
-import org.jfree.chart.JFreeChart;
-import org.jfree.chart.axis.CategoryAxis;
-import org.jfree.chart.axis.CategoryLabelPositions;
-import org.jfree.chart.axis.NumberAxis;
-import org.jfree.chart.axis.ValueAxis;
-import org.jfree.chart.plot.CategoryPlot;
-import org.jfree.chart.plot.PlotOrientation;
-import org.jfree.chart.renderer.category.CategoryItemRenderer;
-import org.jfree.chart.renderer.category.StatisticalBarRenderer;
-import org.jfree.data.general.Dataset;
-import org.jfree.data.statistics.DefaultStatisticalCategoryDataset;
-import org.jfree.data.statistics.StatisticalCategoryDataset;
-
-public class StatisticalBarCharBuilder extends BaseChartBuilder
-{
- private final SeriesBuilder _seriesBuilder;
-
- public StatisticalBarCharBuilder(SeriesBuilder seriesBuilder)
- {
- _seriesBuilder = seriesBuilder;
- }
-
- @Override
- public JFreeChart buildChart(ChartingDefinition chartingDefinition)
- {
- String title = chartingDefinition.getChartTitle();
- String xAxisTitle = chartingDefinition.getXAxisTitle();
- String yAxisTitle = chartingDefinition.getYAxisTitle();
-
- final DefaultStatisticalCategoryDataset dataset = new DefaultStatisticalCategoryDataset();
-
- _seriesBuilder.setSeriesBuilderCallback(new SeriesBuilderCallback()
- {
- @Override
- public void addDataPointToSeries(SeriesDefinition seriesDefinition, Object[] row)
- {
- String x = String.valueOf(row[0]);
- double mean = Double.parseDouble(row[1].toString());
- double stdDev = Double.parseDouble(row[2].toString());
- dataset.add(mean, stdDev, seriesDefinition.getSeriesLegend(), x);
- }
-
- @Override
- public void beginSeries(SeriesDefinition seriesDefinition)
- {
- // unused
- }
-
- @Override
- public void endSeries(SeriesDefinition seriesDefinition)
- {
- // unused
- }
-
- });
-
- _seriesBuilder.build(chartingDefinition.getSeries());
-
- JFreeChart chart = createChartImpl(title, xAxisTitle, yAxisTitle, dataset, PLOT_ORIENTATION, SHOW_LEGEND,
- SHOW_TOOL_TIPS, SHOW_URLS);
-
- chart.getCategoryPlot().getDomainAxis().setCategoryLabelPositions(CategoryLabelPositions.UP_45);
-
- addCommonChartAttributes(chart, chartingDefinition);
-
- return chart;
- }
-
- @Override
- public JFreeChart createChartImpl(String title, String xAxisTitle, String yAxisTitle, final Dataset dataset,
- PlotOrientation plotOrientation, boolean showLegend, boolean showToolTips, boolean showUrls)
- {
- CategoryAxis xAxis = new CategoryAxis(xAxisTitle);
- ValueAxis yAxis = new NumberAxis(yAxisTitle);
- CategoryItemRenderer renderer = new StatisticalBarRenderer();
-
- CategoryPlot plot = new CategoryPlot((StatisticalCategoryDataset) dataset, xAxis, yAxis, renderer);
-
- JFreeChart chart = new JFreeChart(title, new Font("Arial", Font.PLAIN, 10), plot, true);
- return chart;
- }
-
-}
diff --git a/java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/chartbuilder/StatisticalBarChartBuilder.java b/java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/chartbuilder/StatisticalBarChartBuilder.java
new file mode 100644
index 0000000000..c5ad2d7dad
--- /dev/null
+++ b/java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/chartbuilder/StatisticalBarChartBuilder.java
@@ -0,0 +1,114 @@
+/*
+ *
+ * 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.
+ *
+ */
+package org.apache.qpid.disttest.charting.chartbuilder;
+
+import java.awt.Font;
+
+import org.apache.qpid.disttest.charting.definition.SeriesDefinition;
+import org.apache.qpid.disttest.charting.seriesbuilder.DatasetHolder;
+import org.apache.qpid.disttest.charting.seriesbuilder.SeriesBuilder;
+import org.apache.qpid.disttest.charting.seriesbuilder.SeriesRow;
+import org.jfree.chart.JFreeChart;
+import org.jfree.chart.axis.CategoryAxis;
+import org.jfree.chart.axis.CategoryLabelPositions;
+import org.jfree.chart.axis.NumberAxis;
+import org.jfree.chart.axis.ValueAxis;
+import org.jfree.chart.plot.CategoryPlot;
+import org.jfree.chart.plot.PlotOrientation;
+import org.jfree.chart.renderer.category.CategoryItemRenderer;
+import org.jfree.chart.renderer.category.StatisticalBarRenderer;
+import org.jfree.data.general.Dataset;
+import org.jfree.data.statistics.DefaultStatisticalCategoryDataset;
+import org.jfree.data.statistics.StatisticalCategoryDataset;
+
+public class StatisticalBarChartBuilder extends BaseChartBuilder
+{
+ public StatisticalBarChartBuilder(SeriesBuilder seriesBuilder)
+ {
+ super(seriesBuilder);
+ }
+
+ @Override
+ protected DatasetHolder newDatasetHolder()
+ {
+ return new DatasetHolder()
+ {
+ private final DefaultStatisticalCategoryDataset _dataset = new DefaultStatisticalCategoryDataset();
+
+ @Override
+ public void addDataPointToSeries(SeriesDefinition seriesDefinition, SeriesRow row)
+ {
+ String x = row.dimensionAsString(0);
+ double mean = row.dimensionAsDouble(1);
+ double stdDev = row.dimensionAsDouble(2);
+ _dataset.add(mean, stdDev, seriesDefinition.getSeriesLegend(), x);
+ }
+
+ @Override
+ public void beginSeries(SeriesDefinition seriesDefinition)
+ {
+ // unused
+ }
+
+ @Override
+ public void endSeries(SeriesDefinition seriesDefinition)
+ {
+ // unused
+ }
+
+ @Override
+ public int getNumberOfDimensions()
+ {
+ return 3;
+ }
+
+ @Override
+ public Dataset getPopulatedDataset()
+ {
+ return _dataset;
+ }
+ };
+ }
+
+ @Override
+ protected SeriesStrokeAndPaintApplier newStrokeAndPaintApplier()
+ {
+ return new CategoryStrokeAndPaintApplier();
+ }
+
+ @Override
+ public JFreeChart createChartImpl(String title, String xAxisTitle, String yAxisTitle, final Dataset dataset,
+ PlotOrientation plotOrientation, boolean showLegend, boolean showToolTips, boolean showUrls)
+ {
+ CategoryAxis xAxis = new CategoryAxis(xAxisTitle);
+ ValueAxis yAxis = new NumberAxis(yAxisTitle);
+ CategoryItemRenderer renderer = new StatisticalBarRenderer();
+
+ CategoryPlot plot = new CategoryPlot((StatisticalCategoryDataset) dataset, xAxis, yAxis, renderer);
+
+ JFreeChart chart = new JFreeChart(title, new Font("Arial", Font.PLAIN, 10), plot, true);
+
+ chart.getCategoryPlot().getDomainAxis().setCategoryLabelPositions(CategoryLabelPositions.UP_45);
+
+ return chart;
+ }
+
+}
diff --git a/java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/chartbuilder/TimeSeriesHolder.java b/java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/chartbuilder/TimeSeriesHolder.java
new file mode 100644
index 0000000000..803a098dfa
--- /dev/null
+++ b/java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/chartbuilder/TimeSeriesHolder.java
@@ -0,0 +1,70 @@
+/*
+ * 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.
+ *
+ */
+package org.apache.qpid.disttest.charting.chartbuilder;
+
+import java.util.Date;
+
+import org.apache.qpid.disttest.charting.definition.SeriesDefinition;
+import org.apache.qpid.disttest.charting.seriesbuilder.DatasetHolder;
+import org.apache.qpid.disttest.charting.seriesbuilder.SeriesRow;
+import org.jfree.data.general.Dataset;
+import org.jfree.data.time.Millisecond;
+import org.jfree.data.time.RegularTimePeriod;
+import org.jfree.data.time.TimeSeries;
+import org.jfree.data.time.TimeSeriesCollection;
+
+class TimeSeriesHolder implements DatasetHolder
+{
+ private final TimeSeriesCollection _timeSeriesCollection = new TimeSeriesCollection();
+ private TimeSeries _timeSeries;
+
+ @Override
+ public void beginSeries(SeriesDefinition seriesDefinition)
+ {
+ _timeSeries = new TimeSeries(seriesDefinition.getSeriesLegend());
+ }
+
+ @Override
+ public void addDataPointToSeries(SeriesDefinition seriesDefinition, SeriesRow row)
+ {
+ Date x = row.dimensionAsDate(0);
+ double y = row.dimensionAsDouble(1);
+ RegularTimePeriod jfreeChartDate = new Millisecond(x);
+ _timeSeries.add(jfreeChartDate, y);
+ }
+
+ @Override
+ public void endSeries(SeriesDefinition seriesDefinition)
+ {
+ _timeSeriesCollection.addSeries(_timeSeries);
+ }
+
+ @Override
+ public int getNumberOfDimensions()
+ {
+ return 2;
+ }
+
+ @Override
+ public Dataset getPopulatedDataset()
+ {
+ return _timeSeriesCollection;
+ }
+}
\ No newline at end of file
diff --git a/java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/chartbuilder/TimeSeriesLineChartBuilder.java b/java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/chartbuilder/TimeSeriesLineChartBuilder.java
new file mode 100644
index 0000000000..7249ae6332
--- /dev/null
+++ b/java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/chartbuilder/TimeSeriesLineChartBuilder.java
@@ -0,0 +1,59 @@
+/*
+ * 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.
+ *
+ */
+package org.apache.qpid.disttest.charting.chartbuilder;
+
+import org.apache.qpid.disttest.charting.seriesbuilder.DatasetHolder;
+import org.apache.qpid.disttest.charting.seriesbuilder.SeriesBuilder;
+import org.jfree.chart.ChartFactory;
+import org.jfree.chart.JFreeChart;
+import org.jfree.chart.plot.PlotOrientation;
+import org.jfree.data.general.Dataset;
+import org.jfree.data.xy.XYDataset;
+
+public class TimeSeriesLineChartBuilder extends XYDataSetBasedChartBuilder
+{
+ public TimeSeriesLineChartBuilder(SeriesBuilder seriesBuilder)
+ {
+ super(seriesBuilder);
+ }
+
+ @Override
+ protected DatasetHolder newDatasetHolder()
+ {
+ return new TimeSeriesHolder();
+ }
+
+ @Override
+ public JFreeChart createChartImpl(String title, String xAxisTitle,
+ String yAxisTitle, final Dataset dataset, PlotOrientation plotOrientation,
+ boolean showLegend, boolean showToolTips, boolean showUrls)
+ {
+ JFreeChart chart = ChartFactory.createTimeSeriesChart(
+ title,
+ xAxisTitle,
+ yAxisTitle,
+ (XYDataset)dataset,
+ showLegend,
+ showToolTips,
+ showUrls);
+
+ return chart;
+ }
+}
diff --git a/java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/chartbuilder/XYDataSetBasedChartBuilder.java b/java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/chartbuilder/XYDataSetBasedChartBuilder.java
index 87d61ca2ee..575712f06c 100644
--- a/java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/chartbuilder/XYDataSetBasedChartBuilder.java
+++ b/java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/chartbuilder/XYDataSetBasedChartBuilder.java
@@ -19,38 +19,34 @@
*/
package org.apache.qpid.disttest.charting.chartbuilder;
+import java.awt.Color;
+import java.awt.Stroke;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
-import org.apache.qpid.disttest.charting.definition.ChartingDefinition;
import org.apache.qpid.disttest.charting.definition.SeriesDefinition;
-import org.apache.qpid.disttest.charting.seriesbuilder.SeriesBuilderCallback;
+import org.apache.qpid.disttest.charting.seriesbuilder.DatasetHolder;
import org.apache.qpid.disttest.charting.seriesbuilder.SeriesBuilder;
+import org.apache.qpid.disttest.charting.seriesbuilder.SeriesRow;
import org.jfree.chart.JFreeChart;
-import org.jfree.chart.axis.CategoryLabelPositions;
+import org.jfree.data.general.Dataset;
import org.jfree.data.xy.DefaultXYDataset;
public abstract class XYDataSetBasedChartBuilder extends BaseChartBuilder
{
- private final SeriesBuilder _seriesBuilder;
-
public XYDataSetBasedChartBuilder(SeriesBuilder seriesBuilder)
{
- this._seriesBuilder = seriesBuilder;
+ super(seriesBuilder);
}
@Override
- public JFreeChart buildChart(ChartingDefinition chartingDefinition)
+ protected DatasetHolder newDatasetHolder()
{
- String title = chartingDefinition.getChartTitle();
- String xAxisTitle = chartingDefinition.getXAxisTitle();
- String yAxisTitle = chartingDefinition.getYAxisTitle();
-
- final DefaultXYDataset dataset = new DefaultXYDataset();
- _seriesBuilder.setSeriesBuilderCallback(new SeriesBuilderCallback()
+ return new DatasetHolder()
{
+ private final DefaultXYDataset _dataset = new DefaultXYDataset();
private List _xyPairs = null;
@Override
@@ -60,20 +56,24 @@ public abstract class XYDataSetBasedChartBuilder extends BaseChartBuilder
}
@Override
- public void addDataPointToSeries(SeriesDefinition seriesDefinition,
- Object[] row)
+ public void addDataPointToSeries(SeriesDefinition seriesDefinition, SeriesRow row)
{
- double x = Double.parseDouble(row[0].toString());
- double y = Double.parseDouble(row[1].toString());
+ double x = row.dimensionAsDouble(0);
+ double y = row.dimensionAsDouble(1);
_xyPairs.add(new Double[] {x, y});
}
-
@Override
public void endSeries(SeriesDefinition seriesDefinition)
{
double[][] seriesData = listToSeriesDataArray();
- dataset.addSeries(seriesDefinition.getSeriesLegend(), seriesData);
+ _dataset.addSeries(seriesDefinition.getSeriesLegend(), seriesData);
+ }
+
+ @Override
+ public int getNumberOfDimensions()
+ {
+ return 2;
}
private double[][] listToSeriesDataArray()
@@ -86,18 +86,34 @@ public abstract class XYDataSetBasedChartBuilder extends BaseChartBuilder
seriesData[0][i] = xyPair[0];
seriesData[1][i] = xyPair[1];
i++;
- }
+ }
return seriesData;
}
- });
-
- _seriesBuilder.build(chartingDefinition.getSeries());
- JFreeChart chart = createChartImpl(title, xAxisTitle, yAxisTitle,
- dataset, PLOT_ORIENTATION, SHOW_LEGEND, SHOW_TOOL_TIPS, SHOW_URLS);
+ @Override
+ public Dataset getPopulatedDataset()
+ {
+ return _dataset;
+ }
+ };
+ }
- addCommonChartAttributes(chart, chartingDefinition);
+ @Override
+ protected SeriesStrokeAndPaintApplier newStrokeAndPaintApplier()
+ {
+ return new SeriesStrokeAndPaintApplier()
+ {
+ @Override
+ public void setSeriesStroke(int seriesIndex, Stroke stroke, JFreeChart targetChart)
+ {
+ targetChart.getXYPlot().getRenderer().setSeriesStroke(seriesIndex, stroke);
+ }
- return chart;
+ @Override
+ public void setSeriesPaint(int seriesIndex, Color colour, JFreeChart targetChart)
+ {
+ targetChart.getXYPlot().getRenderer().setSeriesPaint(seriesIndex, colour);
+ }
+ };
}
}
diff --git a/java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/definition/ChartingDefinition.java b/java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/definition/ChartingDefinition.java
index 04b3f7ed3b..bfe47e598e 100644
--- a/java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/definition/ChartingDefinition.java
+++ b/java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/definition/ChartingDefinition.java
@@ -30,6 +30,7 @@ public class ChartingDefinition
private final ChartType _chartType;
private final String _chartTitle;
private final String _chartSubtitle;
+ private final String _chartDescription;
private final String _xaxisTitle;
private final String _yaxisTitle;
private final List _seriesDefinitions;
@@ -39,12 +40,14 @@ public class ChartingDefinition
final ChartType chartType,
final String chartTitle,
final String chartSubtitle,
+ final String chartDescription,
final String xaxisTitle, final String yaxisTitle, List seriesDefinitions)
{
_chartStemName = chartStemName;
_chartType = chartType;
_chartTitle = chartTitle;
_chartSubtitle = chartSubtitle;
+ _chartDescription = chartDescription;
_xaxisTitle = xaxisTitle;
_yaxisTitle = yaxisTitle;
_seriesDefinitions = seriesDefinitions;
@@ -65,6 +68,10 @@ public class ChartingDefinition
return _chartSubtitle;
}
+ public String getChartDescription()
+ {
+ return _chartDescription;
+ }
public String getXAxisTitle()
{
@@ -77,17 +84,14 @@ public class ChartingDefinition
return _yaxisTitle;
}
-
-
public ChartType getChartType()
{
return _chartType;
}
- public List getSeries()
+ public List getSeriesDefinitions()
{
return Collections.unmodifiableList(_seriesDefinitions);
}
-
}
diff --git a/java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/definition/ChartingDefinitionCreator.java b/java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/definition/ChartingDefinitionCreator.java
index 4cbc9318a9..1988f561b6 100644
--- a/java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/definition/ChartingDefinitionCreator.java
+++ b/java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/definition/ChartingDefinitionCreator.java
@@ -39,6 +39,7 @@ public class ChartingDefinitionCreator
public static final String CHART_TYPE_KEY = "chartType";
public static final String CHART_TITLE_KEY = "chartTitle";
public static final String CHART_SUBTITLE_KEY = "chartSubtitle";
+ public static final String CHART_DESCRIPTION_KEY = "chartDescription";
public static final String XAXIS_TITLE_KEY = "xAxisTitle";
public static final String YAXIS_TITLE_KEY = "yAxisTitle";
@@ -82,6 +83,7 @@ public class ChartingDefinitionCreator
final ChartType chartType = ChartType.valueOf(props.getProperty(CHART_TYPE_KEY));
final String chartTitle = props.getProperty(CHART_TITLE_KEY);
final String chartSubtitle = props.getProperty(CHART_SUBTITLE_KEY);
+ final String chartDescription = props.getProperty(CHART_DESCRIPTION_KEY);
final String xAxisTitle = props.getProperty(XAXIS_TITLE_KEY);
final String yAxisTitle = props.getProperty(YAXIS_TITLE_KEY);
@@ -91,8 +93,8 @@ public class ChartingDefinitionCreator
chartType,
chartTitle,
chartSubtitle,
- xAxisTitle,
- yAxisTitle, seriesDefinitions);
+ chartDescription,
+ xAxisTitle, yAxisTitle, seriesDefinitions);
return chartDefinition;
}
catch (IOException e)
diff --git a/java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/definition/SeriesDefinition.java b/java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/definition/SeriesDefinition.java
index a39e906957..d89ff855e2 100644
--- a/java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/definition/SeriesDefinition.java
+++ b/java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/definition/SeriesDefinition.java
@@ -19,17 +19,24 @@
*/
package org.apache.qpid.disttest.charting.definition;
+import org.apache.commons.lang.builder.ToStringBuilder;
+import org.apache.commons.lang.builder.ToStringStyle;
+
public class SeriesDefinition
{
private final String _seriesStatement;
private final String _seriesLegend;
private final String _seriesDirectory;
+ private final String _seriesColourName;
+ private final Integer _seriesStrokeWidth;
- public SeriesDefinition(String seriesStatement, String seriesLegend, String seriesDirectory)
+ public SeriesDefinition(String seriesStatement, String seriesLegend, String seriesDirectory, String seriesColourName, Integer seriesStrokeWidth)
{
_seriesStatement = seriesStatement;
_seriesLegend = seriesLegend;
_seriesDirectory = seriesDirectory;
+ _seriesColourName = seriesColourName;
+ _seriesStrokeWidth = seriesStrokeWidth;
}
public String getSeriesStatement()
@@ -47,4 +54,22 @@ public class SeriesDefinition
return _seriesDirectory;
}
+ public String getSeriesColourName()
+ {
+ return _seriesColourName;
+ }
+
+ public Integer getStrokeWidth()
+ {
+ return _seriesStrokeWidth;
+ }
+
+ @Override
+ public String toString()
+ {
+ return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE)
+ .append("seriesLegend", _seriesLegend)
+ .append("seriesStatement", _seriesStatement)
+ .append("seriesDirectory", _seriesDirectory).toString();
+ }
}
diff --git a/java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/definition/SeriesDefinitionCreator.java b/java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/definition/SeriesDefinitionCreator.java
index fcc11807c8..d47e7488e1 100644
--- a/java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/definition/SeriesDefinitionCreator.java
+++ b/java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/definition/SeriesDefinitionCreator.java
@@ -30,6 +30,8 @@ public class SeriesDefinitionCreator
public static final String SERIES_STATEMENT_KEY_FORMAT = "series.%d.statement";
public static final String SERIES_LEGEND_KEY_FORMAT = "series.%d.legend";
public static final String SERIES_DIRECTORY_KEY_FORMAT = "series.%d.dir";
+ public static final String SERIES_COLOUR_NAME_FORMAT = "series.%d.colourName";
+ public static final String SERIES_STROKE_WIDTH_FORMAT = "series.%d.strokeWidth";
public List createFromProperties(Properties properties)
{
@@ -42,10 +44,13 @@ public class SeriesDefinitionCreator
String seriesStatement = properties.getProperty(String.format(SERIES_STATEMENT_KEY_FORMAT, index));
String seriesLegend = properties.getProperty(String.format(SERIES_LEGEND_KEY_FORMAT, index));
String seriesDir = StrSubstitutor.replaceSystemProperties(properties.getProperty(String.format(SERIES_DIRECTORY_KEY_FORMAT, index)));
+ String seriesColourName = properties.getProperty(String.format(SERIES_COLOUR_NAME_FORMAT, index));
+ Integer seriesStrokeWidth = properties.getProperty(String.format(SERIES_STROKE_WIDTH_FORMAT, index)) == null
+ ? null : Integer.parseInt(properties.getProperty(String.format(SERIES_STROKE_WIDTH_FORMAT, index)));
if (seriesStatement != null)
{
- final SeriesDefinition seriesDefinition = new SeriesDefinition(seriesStatement, seriesLegend, seriesDir);
+ final SeriesDefinition seriesDefinition = new SeriesDefinition(seriesStatement, seriesLegend, seriesDir, seriesColourName, seriesStrokeWidth);
seriesDefinitions.add(seriesDefinition);
}
else
diff --git a/java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/seriesbuilder/DatasetHolder.java b/java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/seriesbuilder/DatasetHolder.java
new file mode 100644
index 0000000000..14fd50facc
--- /dev/null
+++ b/java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/seriesbuilder/DatasetHolder.java
@@ -0,0 +1,37 @@
+/*
+ * 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.
+ *
+ */
+package org.apache.qpid.disttest.charting.seriesbuilder;
+
+import org.apache.qpid.disttest.charting.definition.SeriesDefinition;
+import org.jfree.data.general.Dataset;
+
+/**
+ * Accepts data in the form of {@link SeriesDefinition}s and {@link SeriesRow}s,
+ * and returns it as a {@link Dataset} for use by a JFreeChart chart.
+ */
+public interface DatasetHolder
+{
+ int getNumberOfDimensions();
+ void beginSeries(SeriesDefinition seriesDefinition);
+ void addDataPointToSeries(SeriesDefinition seriesDefinition, SeriesRow row);
+ void endSeries(SeriesDefinition seriesDefinition);
+
+ Dataset getPopulatedDataset();
+}
diff --git a/java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/seriesbuilder/JdbcCsvSeriesBuilder.java b/java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/seriesbuilder/JdbcCsvSeriesBuilder.java
deleted file mode 100644
index a9adce0afc..0000000000
--- a/java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/seriesbuilder/JdbcCsvSeriesBuilder.java
+++ /dev/null
@@ -1,141 +0,0 @@
-/*
- * 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.
- *
- */
-package org.apache.qpid.disttest.charting.seriesbuilder;
-
-import java.io.File;
-import java.sql.Connection;
-import java.sql.DriverManager;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.sql.Statement;
-import java.util.Iterator;
-import java.util.List;
-
-import org.apache.qpid.disttest.charting.ChartingException;
-import org.apache.qpid.disttest.charting.definition.SeriesDefinition;
-
-public class JdbcCsvSeriesBuilder implements SeriesBuilder
-{
-
- static
- {
- registerCsvDriver();
- }
-
- private SeriesBuilderCallback _callback;
-
- @Override
- public void setSeriesBuilderCallback(SeriesBuilderCallback callback)
- {
- this._callback = callback;
- }
-
- @Override
- public void build(List seriesDefinitions)
- {
- for (Iterator iterator = seriesDefinitions.iterator(); iterator.hasNext();)
- {
- SeriesDefinition series = iterator.next();
- buildDataSetForSingleSeries(series);
- }
- }
-
- private void buildDataSetForSingleSeries(SeriesDefinition seriesDefinition)
- {
- Connection conn = null;
- Statement stmt = null;
- try
- {
- File seriesDir = getValidatedSeriesDirectory(seriesDefinition);
-
- conn = DriverManager.getConnection("jdbc:relique:csv:" + seriesDir.getAbsolutePath());
-
- final String seriesStatement = seriesDefinition.getSeriesStatement();
-
- stmt = conn.createStatement();
- ResultSet results = stmt.executeQuery(seriesStatement);
- int columnCount = results.getMetaData().getColumnCount();
- _callback.beginSeries(seriesDefinition);
- while (results.next())
- {
- Object[] row = new Object[columnCount];
- for (int i = 0; i < row.length; i++)
- {
- row[i] = results.getObject(i+1);
- }
-
- _callback.addDataPointToSeries(seriesDefinition, row);
- }
- _callback.endSeries(seriesDefinition);
- }
- catch (SQLException e)
- {
- throw new ChartingException("Failed to create chart dataset", e);
- }
- finally
- {
- if (stmt != null)
- {
- try
- {
- stmt.close();
- }
- catch (SQLException e)
- {
- throw new RuntimeException("Failed to close statement", e);
- }
- }
- if (conn != null)
- {
- try
- {
- conn.close();
- }
- catch (SQLException e)
- {
- throw new RuntimeException("Failed to close connection", e);
- }
- }
- }
- }
-
- private File getValidatedSeriesDirectory(SeriesDefinition series)
- {
- File seriesDir = new File(series.getSeriesDirectory());
- if (!seriesDir.isDirectory())
- {
- throw new ChartingException("seriesDirectory must be a directory : " + seriesDir);
- }
- return seriesDir;
- }
-
- private static void registerCsvDriver() throws ExceptionInInitializerError
- {
- try
- {
- Class.forName("org.relique.jdbc.csv.CsvDriver");
- }
- catch (ClassNotFoundException e)
- {
- throw new RuntimeException("Could not load CSV/JDBC driver", e);
- }
- }
-
-}
diff --git a/java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/seriesbuilder/JdbcSeriesBuilder.java b/java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/seriesbuilder/JdbcSeriesBuilder.java
new file mode 100644
index 0000000000..180aa54c6d
--- /dev/null
+++ b/java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/seriesbuilder/JdbcSeriesBuilder.java
@@ -0,0 +1,157 @@
+/*
+ * 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.
+ *
+ */
+package org.apache.qpid.disttest.charting.seriesbuilder;
+
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.Statement;
+import java.util.Iterator;
+import java.util.List;
+
+import org.apache.commons.lang.builder.ToStringBuilder;
+import org.apache.commons.lang.builder.ToStringStyle;
+import org.apache.qpid.disttest.charting.ChartingException;
+import org.apache.qpid.disttest.charting.definition.SeriesDefinition;
+import org.jfree.data.general.Dataset;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * A {@link SeriesBuilder} that uses JDBC to read series data.
+ * The actual JDBC URL used is determined by my {@link JdbcUrlGenerator}.
+ */
+public class JdbcSeriesBuilder implements SeriesBuilder
+{
+ private static final Logger LOGGER = LoggerFactory.getLogger(JdbcSeriesBuilder.class);
+
+ private DatasetHolder _datasetHolder;
+
+ private final JdbcUrlGenerator _jdbcUrlGenerator;
+
+ /**
+ * @param providedJdbcUrl the JDBC URL. Provide null if the value should be
+ * inferred by {@link #_jdbcUrlGenerator}.
+ */
+ public JdbcSeriesBuilder(String jdbcDriverClass, String providedJdbcUrl)
+ {
+ registerDriver(jdbcDriverClass);
+ _jdbcUrlGenerator = new JdbcUrlGenerator(providedJdbcUrl);
+ LOGGER.info("Created: " + this);
+ }
+
+ @Override
+ public void setDatasetHolder(DatasetHolder callback)
+ {
+ _datasetHolder = callback;
+ }
+
+ @Override
+ public Dataset build(List seriesDefinitions)
+ {
+ for (Iterator iterator = seriesDefinitions.iterator(); iterator.hasNext();)
+ {
+ SeriesDefinition series = iterator.next();
+ buildDataSetForSingleSeries(series);
+ }
+ return _datasetHolder.getPopulatedDataset();
+ }
+
+ private void buildDataSetForSingleSeries(SeriesDefinition seriesDefinition)
+ {
+ Connection conn = null;
+ Statement stmt = null;
+ try
+ {
+ String jdbcUrl = _jdbcUrlGenerator.getJdbcUrl(seriesDefinition);
+ conn = DriverManager.getConnection(jdbcUrl);
+
+ final String seriesStatement = seriesDefinition.getSeriesStatement();
+
+ stmt = conn.createStatement();
+ ResultSet results = stmt.executeQuery(seriesStatement);
+ int columnCount = results.getMetaData().getColumnCount();
+ _datasetHolder.beginSeries(seriesDefinition);
+ while (results.next())
+ {
+ Object[] row = new Object[columnCount];
+ for (int i = 0; i < row.length; i++)
+ {
+ row[i] = results.getObject(i+1);
+ }
+
+ SeriesRow seriesRow = SeriesRow.createValidSeriesRow(_datasetHolder.getNumberOfDimensions(), row);
+ _datasetHolder.addDataPointToSeries(seriesDefinition, seriesRow);
+ }
+ _datasetHolder.endSeries(seriesDefinition);
+ }
+ catch (SQLException e)
+ {
+ throw new ChartingException("Failed to create chart dataset", e);
+ }
+ finally
+ {
+ if (stmt != null)
+ {
+ try
+ {
+ stmt.close();
+ }
+ catch (SQLException e)
+ {
+ throw new RuntimeException("Failed to close statement", e);
+ }
+ }
+ if (conn != null)
+ {
+ try
+ {
+ conn.close();
+ }
+ catch (SQLException e)
+ {
+ throw new RuntimeException("Failed to close connection", e);
+ }
+ }
+ }
+ }
+
+ private void registerDriver(String driverClassName) throws ExceptionInInitializerError
+ {
+ try
+ {
+ Class.forName(driverClassName);
+ LOGGER.info("Loaded JDBC driver class " + driverClassName);
+ }
+ catch (ClassNotFoundException e)
+ {
+ throw new RuntimeException("Could not load JDBC driver " + driverClassName, e);
+ }
+ }
+
+ @Override
+ public String toString()
+ {
+ return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE)
+ .append("jdbcUrlGenerator", _jdbcUrlGenerator)
+ .toString();
+ }
+}
diff --git a/java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/seriesbuilder/JdbcUrlGenerator.java b/java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/seriesbuilder/JdbcUrlGenerator.java
new file mode 100644
index 0000000000..77f367b0f1
--- /dev/null
+++ b/java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/seriesbuilder/JdbcUrlGenerator.java
@@ -0,0 +1,81 @@
+/*
+ * 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.
+ */
+package org.apache.qpid.disttest.charting.seriesbuilder;
+
+import static org.apache.commons.lang.StringUtils.isBlank;
+import static org.apache.commons.lang.StringUtils.isNotBlank;
+
+import org.apache.commons.lang.builder.ToStringBuilder;
+import org.apache.commons.lang.builder.ToStringStyle;
+import org.apache.qpid.disttest.charting.definition.SeriesDefinition;
+
+public class JdbcUrlGenerator
+{
+ private String _providedJdbdUrl;
+
+ public static final String DEFAULT_JDBC_DRIVER_NAME = "org.relique.jdbc.csv.CsvDriver";
+
+ /**
+ * Used to create the JDBC URL if one has not been passed in.
+ */
+ private static final String CSV_JDBC_URL_BASE = "jdbc:relique:csv:";
+
+ /**
+ * @param providedJdbcUrl the JDBC URL. Provide null if the value should be
+ * inferred.
+ */
+ public JdbcUrlGenerator(String providedJdbcUrl)
+ {
+ _providedJdbdUrl = providedJdbcUrl;
+ }
+
+ /**
+ * Returns either the provided value ({@link #_providedJdbdUrl})
+ * or a CSV JDBC URL pointing at {@link SeriesDefinition#getSeriesDirectory()} value.
+ */
+ public String getJdbcUrl(SeriesDefinition seriesDefinition)
+ {
+ String seriesDir = seriesDefinition.getSeriesDirectory();
+
+ if(_providedJdbdUrl == null)
+ {
+ if(isBlank(seriesDir))
+ {
+ throw new IllegalArgumentException("Neither a series directory nor a JDBC url have been specified. Series definition: " + seriesDefinition);
+ }
+ return CSV_JDBC_URL_BASE + seriesDir;
+ }
+ else
+ {
+ if(isNotBlank(seriesDir))
+ {
+ throw new IllegalArgumentException("Both a series directory '" + seriesDir + "' and a JDBC url have been specified. Series definition: " + seriesDefinition);
+ }
+ return _providedJdbdUrl;
+ }
+ }
+
+ @Override
+ public String toString()
+ {
+ return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE)
+ .append("providedJdbdUrl", _providedJdbdUrl)
+ .toString();
+ }
+}
\ No newline at end of file
diff --git a/java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/seriesbuilder/SeriesBuilder.java b/java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/seriesbuilder/SeriesBuilder.java
index 86e471efaf..a865c838c6 100644
--- a/java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/seriesbuilder/SeriesBuilder.java
+++ b/java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/seriesbuilder/SeriesBuilder.java
@@ -22,11 +22,20 @@ package org.apache.qpid.disttest.charting.seriesbuilder;
import java.util.List;
import org.apache.qpid.disttest.charting.definition.SeriesDefinition;
+import org.jfree.data.general.Dataset;
public interface SeriesBuilder
{
- void build(List seriesDefinitions);
-
- void setSeriesBuilderCallback(SeriesBuilderCallback seriesBuilderCallback);
+ /**
+ * Uses the supplied {@link SeriesDefinition}s to read the series data
+ * and pass it to the dataset holder set up in {@link #setDatasetHolder(DatasetHolder)}.
+ *
+ * @return the populated dataset
+ */
+ Dataset build(List seriesDefinitions);
+ /**
+ * Stores the supplied dataset holder so it can be populated in {@link #build(List)}.
+ */
+ void setDatasetHolder(DatasetHolder datasetHolder);
}
\ No newline at end of file
diff --git a/java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/seriesbuilder/SeriesBuilderCallback.java b/java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/seriesbuilder/SeriesBuilderCallback.java
deleted file mode 100644
index 7e23953fdb..0000000000
--- a/java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/seriesbuilder/SeriesBuilderCallback.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * 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.
- *
- */
-package org.apache.qpid.disttest.charting.seriesbuilder;
-
-import org.apache.qpid.disttest.charting.definition.SeriesDefinition;
-
-public interface SeriesBuilderCallback
-{
- public void beginSeries(SeriesDefinition seriesDefinition);
- public void addDataPointToSeries(SeriesDefinition seriesDefinition, Object[] row);
- public void endSeries(SeriesDefinition seriesDefinition);
-
-}
diff --git a/java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/seriesbuilder/SeriesRow.java b/java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/seriesbuilder/SeriesRow.java
new file mode 100644
index 0000000000..9c16866939
--- /dev/null
+++ b/java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/seriesbuilder/SeriesRow.java
@@ -0,0 +1,98 @@
+/*
+ * 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.
+ */
+package org.apache.qpid.disttest.charting.seriesbuilder;
+
+import java.util.Arrays;
+import java.util.Date;
+
+import org.apache.commons.lang.builder.EqualsBuilder;
+import org.apache.commons.lang.builder.HashCodeBuilder;
+
+/**
+ * A data point in a chart. Thinly wraps an array to provide a convenient place to validate the number of dimensions,
+ * and to access dimensions in a typesafe manner.
+ */
+public class SeriesRow
+{
+ private final Object[] _dimensions;
+
+ public static SeriesRow createValidSeriesRow(int expectedNumberOfDimensions, Object[] dimensions)
+ {
+ int actualNumberOfDimensions = dimensions.length;
+ if(expectedNumberOfDimensions != actualNumberOfDimensions)
+ {
+ throw new IllegalArgumentException("Expected " + expectedNumberOfDimensions
+ + " dimensions but found " + actualNumberOfDimensions
+ + " in: " + Arrays.asList(dimensions));
+ }
+ return new SeriesRow(dimensions);
+ }
+
+ public SeriesRow(Object... dimensions)
+ {
+ _dimensions = dimensions;
+ }
+
+ public Object dimension(int dimension)
+ {
+ return _dimensions[dimension];
+ }
+
+ public String dimensionAsString(int dimension)
+ {
+ return String.valueOf(dimension(dimension));
+ }
+
+ public double dimensionAsDouble(int dimension)
+ {
+ return Double.parseDouble(dimensionAsString(dimension));
+ }
+
+ public Date dimensionAsDate(int dimension)
+ {
+ return (Date) dimension(dimension);
+ }
+
+ @Override
+ public int hashCode()
+ {
+ return new HashCodeBuilder().append(_dimensions).toHashCode();
+ }
+
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (obj == null)
+ {
+ return false;
+ }
+ if (obj == this)
+ {
+ return true;
+ }
+ if (obj.getClass() != getClass())
+ {
+ return false;
+ }
+ SeriesRow rhs = (SeriesRow) obj;
+ return new EqualsBuilder().append(_dimensions, rhs._dimensions).isEquals();
+ }
+
+
+}
\ No newline at end of file
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 5d4a9b6b7e..341f01ccd1 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
@@ -26,10 +26,11 @@ import java.io.FileOutputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.io.OutputStream;
-import java.util.SortedSet;
-import java.util.TreeSet;
+import java.util.SortedMap;
+import java.util.TreeMap;
import org.apache.qpid.disttest.charting.ChartingException;
+import org.apache.qpid.disttest.charting.definition.ChartingDefinition;
import org.jfree.chart.ChartUtilities;
import org.jfree.chart.JFreeChart;
import org.slf4j.Logger;
@@ -42,19 +43,19 @@ public class ChartWriter
static final String SUMMARY_FILE_NAME = "chart-summary.html";
private File _chartDirectory = new File(".");
- private SortedSet _chartFiles = new TreeSet();
+ private SortedMap _chartFilesToChartDef = new TreeMap();
- public void writeChartToFileSystem(JFreeChart chart, String chartStemName)
+ public void writeChartToFileSystem(JFreeChart chart, ChartingDefinition chartDef)
{
OutputStream pngOutputStream = null;
try
{
- File pngFile = new File(_chartDirectory, chartStemName + ".png");
+ File pngFile = new File(_chartDirectory, chartDef.getChartStemName() + ".png");
pngOutputStream = new BufferedOutputStream(new FileOutputStream(pngFile));
ChartUtilities.writeChartAsPNG(pngOutputStream, chart, 600, 400, true, 0);
pngOutputStream.close();
- _chartFiles.add(pngFile);
+ _chartFilesToChartDef.put(pngFile, chartDef);
LOGGER.info("Written {} chart", pngFile);
}
@@ -78,20 +79,21 @@ public class ChartWriter
}
}
- public void writeHtmlSummaryToFileSystem()
+ public void writeHtmlSummaryToFileSystem(String summaryPageTitle)
{
- if(_chartFiles.size() < 2)
+ if(_chartFilesToChartDef.size() < 2)
{
- LOGGER.info("Only " + _chartFiles.size() + " chart image(s) have been written so no HTML summary file will be produced");
+ LOGGER.info("Only {} chart image(s) have been written so no HTML summary file will be produced", _chartFilesToChartDef.size());
return;
}
- String htmlHeader =
+ String htmlHeader = String.format(
"\n" +
" \n" +
- " Performance Charts\n" +
+ " %s\n" +
+ " \n" +
" \n" +
- " \n";
+ " \n", summaryPageTitle);
String htmlFooter =
" \n" +
@@ -101,22 +103,29 @@ public class ChartWriter
try
{
File summaryFile = new File(_chartDirectory, SUMMARY_FILE_NAME);
- LOGGER.debug("About to produce HTML summary file " + summaryFile.getAbsolutePath() + " from charts " + _chartFiles);
+ LOGGER.debug("About to produce HTML summary file " + summaryFile.getAbsolutePath() + " from charts " + _chartFilesToChartDef);
writer = new BufferedWriter(new FileWriter(summaryFile));
writer.write(htmlHeader);
writer.write("
\n");
- for (File chartFile : _chartFiles)
+ for (File chartFile : _chartFilesToChartDef.keySet())
{
writer.write("