aboutsummaryrefslogtreecommitdiffstats
path: root/vespa-feed-client/src/test/java
diff options
context:
space:
mode:
authorJon Marius Venstad <venstad@gmail.com>2021-06-30 13:36:48 +0200
committerJon Marius Venstad <venstad@gmail.com>2021-06-30 13:36:48 +0200
commit890b2ceff15f244ac9a5bf44fba9ba0aa9f5ab8d (patch)
treeae3691244605c4701ff7beb12ae3d9eb0f0e0f3d /vespa-feed-client/src/test/java
parent49833295b149f33c97961a56a689b00efc76f24b (diff)
Compute benchmark stats difference
Diffstat (limited to 'vespa-feed-client/src/test/java')
-rw-r--r--vespa-feed-client/src/test/java/ai/vespa/feed/client/HttpRequestStrategyTest.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/vespa-feed-client/src/test/java/ai/vespa/feed/client/HttpRequestStrategyTest.java b/vespa-feed-client/src/test/java/ai/vespa/feed/client/HttpRequestStrategyTest.java
index beb231b61d4..c40735b3b2a 100644
--- a/vespa-feed-client/src/test/java/ai/vespa/feed/client/HttpRequestStrategyTest.java
+++ b/vespa-feed-client/src/test/java/ai/vespa/feed/client/HttpRequestStrategyTest.java
@@ -91,6 +91,7 @@ class HttpRequestStrategyTest {
.setConnectionsPerEndpoint(1)
.setMaxStreamPerConnection(minStreams),
new BenchmarkingCluster(cluster));
+ OperationStats initial = strategy.stats();
DocumentId id1 = DocumentId.of("ns", "type", "1");
DocumentId id2 = DocumentId.of("ns", "type", "2");
@@ -176,6 +177,11 @@ class HttpRequestStrategyTest {
codes.put(500, 3L);
assertEquals(codes, strategy.stats().responsesByCode());
assertEquals(3, strategy.stats().exceptions());
+
+ assertEquals(strategy.stats(), strategy.stats().since(initial));
+ assertEquals(0, strategy.stats().since(strategy.stats()).averageLatencyMillis());
+ assertEquals(0, strategy.stats().since(strategy.stats()).requests());
+ assertEquals(0, strategy.stats().since(strategy.stats()).bytesSent());
}
@Test