diff options
| author | Martin Ritchie <ritchiem@apache.org> | 2010-04-12 15:42:47 +0000 |
|---|---|---|
| committer | Martin Ritchie <ritchiem@apache.org> | 2010-04-12 15:42:47 +0000 |
| commit | b1bffee58eeadcd846dd300fcb26ccf3e7250a10 (patch) | |
| tree | 4707202232214641d4eeabb4a9610644a457c89d /qpid/java/perftests | |
| parent | 9da586a72784508e3b7c04e19639cb3907fa1ab5 (diff) | |
| download | qpid-python-b1bffee58eeadcd846dd300fcb26ccf3e7250a10.tar.gz | |
QPID-2425 : Augmented JUnit-Toolkit to emit latency information already gathed by the PingAsyncTestPerf for each batch.
Merged from 0.5.x-dev r 917464
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@933283 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/java/perftests')
| -rw-r--r-- | qpid/java/perftests/src/main/java/org/apache/qpid/ping/PingAsyncTestPerf.java | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/qpid/java/perftests/src/main/java/org/apache/qpid/ping/PingAsyncTestPerf.java b/qpid/java/perftests/src/main/java/org/apache/qpid/ping/PingAsyncTestPerf.java index d8fea85477..9ed9fea299 100644 --- a/qpid/java/perftests/src/main/java/org/apache/qpid/ping/PingAsyncTestPerf.java +++ b/qpid/java/perftests/src/main/java/org/apache/qpid/ping/PingAsyncTestPerf.java @@ -228,6 +228,9 @@ public class PingAsyncTestPerf extends PingTestPerf implements TimingControllerA /** The test results logging batch size. */ int _batchSize; + /** The latency recoreded for the batch */ + private long _batchLatency = 0; + /** * Creates a results listener on the specified batch size. * @@ -250,6 +253,8 @@ public class PingAsyncTestPerf extends PingTestPerf implements TimingControllerA */ public void onMessage(Message message, int remainingCount, long latency) throws JMSException { + // Record the latency for the whole batch + _batchLatency += latency; // Check if a batch boundary has been crossed. if ((remainingCount % _batchSize) == 0) { @@ -278,7 +283,11 @@ public class PingAsyncTestPerf extends PingTestPerf implements TimingControllerA // Register a test result for the correlation id. try { - tc.completeTest(true, receivedInBatch); + // Record the total latency for the batch. + // if batchSize=1 then this will just be the message latency + tc.completeTest(true, receivedInBatch, null, _batchLatency); + // Reset latency + _batchLatency = 0; } catch (InterruptedException e) { |
