summaryrefslogtreecommitdiff
path: root/qpid/java/perftests/src/test
diff options
context:
space:
mode:
authorRobert Gemmell <robbie@apache.org>2012-09-20 15:28:02 +0000
committerRobert Gemmell <robbie@apache.org>2012-09-20 15:28:02 +0000
commit6a19ed06e9fb321c1f8dc27b99b70565dfed82b1 (patch)
treef5094230065d548a89ff43cecefe0cf91ad64431 /qpid/java/perftests/src/test
parentcfe1bb615871bec30f849471d8a5d2180c2a8818 (diff)
downloadqpid-python-6a19ed06e9fb321c1f8dc27b99b70565dfed82b1.tar.gz
QPID-4310: Display performance test results in messages per second
Applied patch from Oleksandr Rudyy <orudyy@gmail.com> git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1388072 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/java/perftests/src/test')
-rw-r--r--qpid/java/perftests/src/test/java/org/apache/qpid/disttest/results/aggregation/ParticipantResultAggregatorTest.java24
-rw-r--r--qpid/java/perftests/src/test/java/org/apache/qpid/disttest/results/aggregation/TestResultAggregatorTest.java4
-rw-r--r--qpid/java/perftests/src/test/java/org/apache/qpid/disttest/results/formatting/CSVFormatterTest.java3
-rw-r--r--qpid/java/perftests/src/test/java/org/apache/qpid/disttest/results/formatting/expectedOutput.csv4
4 files changed, 32 insertions, 3 deletions
diff --git a/qpid/java/perftests/src/test/java/org/apache/qpid/disttest/results/aggregation/ParticipantResultAggregatorTest.java b/qpid/java/perftests/src/test/java/org/apache/qpid/disttest/results/aggregation/ParticipantResultAggregatorTest.java
index 72743be1d1..db2c709f55 100644
--- a/qpid/java/perftests/src/test/java/org/apache/qpid/disttest/results/aggregation/ParticipantResultAggregatorTest.java
+++ b/qpid/java/perftests/src/test/java/org/apache/qpid/disttest/results/aggregation/ParticipantResultAggregatorTest.java
@@ -39,15 +39,19 @@ public class ParticipantResultAggregatorTest extends TestCase
private static final long PARTICIPANT1_STARTDATE = 50;
private static final long PARTICIPANT1_ENDDATE = 20000;
private static final long PARTICIPANT1_TOTAL_PROCESSED = 1024;
+ private static final int PARTICIPANT1_NUMBER_OF_MESSAGES_PROCESSED = 20000;
private static final long PARTICIPANT2_STARTDATE = 100;
private static final long PARTICIPANT2_ENDDATE = 21000;
private static final long PARTICIPANT2_TOTAL_PROCESSED = 2048;
+ private static final int PARTICIPANT2_NUMBER_OF_MESSAGES_PROCESSED = 950;
private static final long OVERALL_PROCESSED = PARTICIPANT1_TOTAL_PROCESSED + PARTICIPANT2_TOTAL_PROCESSED;
private static final double OVERALL_TIMETAKEN = PARTICIPANT2_ENDDATE - PARTICIPANT1_STARTDATE;
+ private static final long OVERALL_NUMBER_OF_MESSAGES_PROCESSED = PARTICIPANT1_NUMBER_OF_MESSAGES_PROCESSED + PARTICIPANT2_NUMBER_OF_MESSAGES_PROCESSED;
private static final double EXPECTED_AGGREGATED_ALL_THROUGHPUT = ((OVERALL_PROCESSED)/1024)/((OVERALL_TIMETAKEN)/1000);
+ private static final int EXPECTED_AGGREGATED_MESSAGE_THROUGHPUT = (int)(OVERALL_NUMBER_OF_MESSAGES_PROCESSED * 1000.0d/OVERALL_TIMETAKEN);
public void testStartAndEndDateForOneParticipantResult()
{
@@ -128,6 +132,26 @@ public class ParticipantResultAggregatorTest extends TestCase
assertEquals(EXPECTED_AGGREGATED_ALL_THROUGHPUT, aggregratedResult.getThroughput(), 0.1);
}
+ public void testComputeMessageThroughput()
+ {
+ ParticipantResult result1 = new ParticipantResult();
+ result1.setStartDate(new Date(PARTICIPANT1_STARTDATE));
+ result1.setEndDate(new Date(PARTICIPANT1_ENDDATE));
+ result1.setNumberOfMessagesProcessed(PARTICIPANT1_NUMBER_OF_MESSAGES_PROCESSED);
+
+ ParticipantResult result2 = new ParticipantResult();
+ result2.setStartDate(new Date(PARTICIPANT2_STARTDATE));
+ result2.setEndDate(new Date(PARTICIPANT2_ENDDATE));
+ result2.setNumberOfMessagesProcessed(PARTICIPANT2_NUMBER_OF_MESSAGES_PROCESSED);
+
+ _aggregator.aggregate(result1);
+ _aggregator.aggregate(result2);
+
+ ParticipantResult aggregratedResult = _aggregator.getAggregatedResult();
+ assertEquals(EXPECTED_AGGREGATED_MESSAGE_THROUGHPUT, aggregratedResult.getMessageThroughput());
+
+ }
+
public void testConstantTestNameAndIterationNumberRolledUp() throws Exception
{
ParticipantResult result1 = new ParticipantResult();
diff --git a/qpid/java/perftests/src/test/java/org/apache/qpid/disttest/results/aggregation/TestResultAggregatorTest.java b/qpid/java/perftests/src/test/java/org/apache/qpid/disttest/results/aggregation/TestResultAggregatorTest.java
index 7cb9ebed5e..c90e60e76d 100644
--- a/qpid/java/perftests/src/test/java/org/apache/qpid/disttest/results/aggregation/TestResultAggregatorTest.java
+++ b/qpid/java/perftests/src/test/java/org/apache/qpid/disttest/results/aggregation/TestResultAggregatorTest.java
@@ -169,6 +169,10 @@ public class TestResultAggregatorTest extends TestCase
aggregatedTestResult.getAllParticipantResult(),
TEST1_NAME, TEST1_ITERATION_NUMBER,
BATCH_SIZE, NUMBER_OF_MESSAGES_CONSUMED_IN_TOTAL, 2, 1);
+
+ int expectedThroughtput = (int)Math.round(NUMBER_OF_MESSAGES_PRODUCED * 1000.0d /(CONSUMER2_ENDDATE - PRODUCER_STARTDATE));
+ ParticipantResult result = aggregatedTestResult.getAllParticipantResult();
+ assertEquals("Unexpected message throughtput", expectedThroughtput, result.getMessageThroughput());
}
private void assertLatencyAggregatedResults(ParticipantResult allConsumerParticipantResult)
diff --git a/qpid/java/perftests/src/test/java/org/apache/qpid/disttest/results/formatting/CSVFormatterTest.java b/qpid/java/perftests/src/test/java/org/apache/qpid/disttest/results/formatting/CSVFormatterTest.java
index 0d66c7ffb5..8d598a8095 100644
--- a/qpid/java/perftests/src/test/java/org/apache/qpid/disttest/results/formatting/CSVFormatterTest.java
+++ b/qpid/java/perftests/src/test/java/org/apache/qpid/disttest/results/formatting/CSVFormatterTest.java
@@ -96,7 +96,7 @@ public class CSVFormatterTest extends TestCase
participantAttributes.put(ITERATION_NUMBER, 0);
participantAttributes.put(CONFIGURED_CLIENT_NAME, CONFIGURED_CLIENT1);
participantAttributes.put(PARTICIPANT_NAME, PARTICIPANT);
- participantAttributes.put(NUMBER_OF_MESSAGES_PROCESSED, 0);
+ participantAttributes.put(NUMBER_OF_MESSAGES_PROCESSED, 2);
participantAttributes.put(PAYLOAD_SIZE, 1);
participantAttributes.put(PRIORITY, 2);
participantAttributes.put(TIME_TO_LIVE, 3);
@@ -122,6 +122,7 @@ public class CSVFormatterTest extends TestCase
participantAttributes.put(MAX_LATENCY, 9l);
participantAttributes.put(AVERAGE_LATENCY, 4.6f);
participantAttributes.put(LATENCY_STANDARD_DEVIATION, 2.0f);
+ participantAttributes.put(MESSAGE_THROUGHPUT, 2);
return participantAttributes;
}
diff --git a/qpid/java/perftests/src/test/java/org/apache/qpid/disttest/results/formatting/expectedOutput.csv b/qpid/java/perftests/src/test/java/org/apache/qpid/disttest/results/formatting/expectedOutput.csv
index a5881e187a..02ea67d56d 100644
--- a/qpid/java/perftests/src/test/java/org/apache/qpid/disttest/results/formatting/expectedOutput.csv
+++ b/qpid/java/perftests/src/test/java/org/apache/qpid/disttest/results/formatting/expectedOutput.csv
@@ -1,2 +1,2 @@
-testName,iterationNumber,throughputKbPerS,averageLatency,clientName,participantName,numberOfMessages,payloadSizeB,priority,timeToLiveMs,acknowledgeMode,deliveryMode,batchSize,maximumDurationMs,producerStartDelayMs,producerIntervalMs,isTopic,isDurableSubscription,isBrowsingSubscription,isSelector,isNoLocal,isSynchronousConsumer,totalNumberOfConsumers,totalNumberOfProducers,totalPayloadProcessedB,timeTakenMs,errorMessage,minLatency,maxLatency,latencyStandardDeviation
-TEST1,0,2048,5,CONFIGURED_CLIENT1,PARTICIPANT,0,1,2,3,4,5,6,7,8,9,true,false,true,false,true,false,1,2,1024,1000,error,2,9,2.0
+testName,iterationNumber,throughputKbPerS,averageLatency,clientName,participantName,numberOfMessages,payloadSizeB,priority,timeToLiveMs,acknowledgeMode,deliveryMode,batchSize,maximumDurationMs,producerStartDelayMs,producerIntervalMs,isTopic,isDurableSubscription,isBrowsingSubscription,isSelector,isNoLocal,isSynchronousConsumer,totalNumberOfConsumers,totalNumberOfProducers,totalPayloadProcessedB,timeTakenMs,errorMessage,minLatency,maxLatency,latencyStandardDeviation,throughputMessagesPerS
+TEST1,0,2048,5,CONFIGURED_CLIENT1,PARTICIPANT,2,1,2,3,4,5,6,7,8,9,true,false,true,false,true,false,1,2,1024,1000,error,2,9,2.0,2