summaryrefslogtreecommitdiffstats
path: root/storage/src/tests/storageserver
diff options
context:
space:
mode:
authorTor Brede Vekterli <vekterli@yahooinc.com>2021-10-19 12:56:45 +0000
committerTor Brede Vekterli <vekterli@yahooinc.com>2021-10-19 12:56:45 +0000
commitd0ea77e42c0515aed09198fec65bd0387fadfc7c (patch)
treeb7c7aaee7be453f492d066e23281060e65c0278c /storage/src/tests/storageserver
parentc470153ae358d0241303919c47915e2c9ad0a7b7 (diff)
Add metric for active merge throttler window size
Diffstat (limited to 'storage/src/tests/storageserver')
-rw-r--r--storage/src/tests/storageserver/mergethrottlertest.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/storage/src/tests/storageserver/mergethrottlertest.cpp b/storage/src/tests/storageserver/mergethrottlertest.cpp
index 568eee1e92c..5c192942521 100644
--- a/storage/src/tests/storageserver/mergethrottlertest.cpp
+++ b/storage/src/tests/storageserver/mergethrottlertest.cpp
@@ -1151,6 +1151,10 @@ TEST_F(MergeThrottlerTest, busy_returned_on_full_queue_for_merges_sent_from_dist
size_t maxQueue = _throttlers[0]->getMaxQueueSize();
ASSERT_EQ(20, maxQueue);
ASSERT_LT(maxPending, 100);
+
+ EXPECT_EQ(_throttlers[0]->getMetrics().active_window_size.getLast(), 0);
+ EXPECT_EQ(_throttlers[0]->getMetrics().queueSize.getLast(), 0);
+
for (size_t i = 0; i < maxPending + maxQueue; ++i) {
std::vector<MergeBucketCommand::Node> nodes({{0}, {1}, {2}});
// No chain set, i.e. merge command is freshly squeezed from a distributor.
@@ -1162,6 +1166,7 @@ TEST_F(MergeThrottlerTest, busy_returned_on_full_queue_for_merges_sent_from_dist
// Wait till we have maxPending replies and maxQueue queued
_topLinks[0]->waitForMessages(maxPending, _messageWaitTime);
waitUntilMergeQueueIs(*_throttlers[0], maxQueue, _messageWaitTime);
+ EXPECT_EQ(_throttlers[0]->getMetrics().active_window_size.getLast(), maxPending);
EXPECT_EQ(maxQueue, _throttlers[0]->getMetrics().queueSize.getMaximum());
// Clear all forwarded merges