summaryrefslogtreecommitdiffstats
path: root/storage/src/tests/distributor
diff options
context:
space:
mode:
authorTor Brede Vekterli <vekterli@yahooinc.com>2023-05-16 11:32:03 +0000
committerTor Brede Vekterli <vekterli@yahooinc.com>2023-05-16 11:40:34 +0000
commit80a8d657cbf2b26f7de65c813dc140bfd50d10fa (patch)
tree663380793f993ba3ce3be318c4482508387a2fc5 /storage/src/tests/distributor
parenta98b18cd45e8fae74a9e71c331698b7ed149ae98 (diff)
Add dedicated condition probe metrics for `PutOperation`/`RemoveOperation`
Follows the same pattern as that used for sub-operation metrics for write-repair during Update processing.
Diffstat (limited to 'storage/src/tests/distributor')
-rw-r--r--storage/src/tests/distributor/check_condition_test.cpp16
-rw-r--r--storage/src/tests/distributor/putoperationtest.cpp3
-rw-r--r--storage/src/tests/distributor/removeoperationtest.cpp3
3 files changed, 20 insertions, 2 deletions
diff --git a/storage/src/tests/distributor/check_condition_test.cpp b/storage/src/tests/distributor/check_condition_test.cpp
index 1b5cede8af6..ee8c9b888bb 100644
--- a/storage/src/tests/distributor/check_condition_test.cpp
+++ b/storage/src/tests/distributor/check_condition_test.cpp
@@ -253,4 +253,20 @@ TEST_F(CheckConditionTest, nested_get_traces_are_propagated_to_outcome) {
});
}
+TEST_F(CheckConditionTest, condition_evaluation_increments_probe_latency_metrics) {
+ getClock().setAbsoluteTimeInSeconds(1);
+ EXPECT_EQ(_metrics.latency.getLongValue("count"), 0);
+ EXPECT_EQ(_metrics.ok.getLongValue("last"), 0);
+ test_cond_with_2_gets_sent([&](auto& cond) {
+ cond.handle_reply(_sender, make_matched_reply(0));
+ getClock().setAbsoluteTimeInSeconds(3);
+ cond.handle_reply(_sender, make_matched_reply(1));
+ }, [&](auto& outcome) noexcept {
+ (void)outcome;
+ });
+ EXPECT_EQ(_metrics.latency.getLongValue("count"), 1);
+ EXPECT_EQ(_metrics.ok.getLongValue("last"), 1);
+ EXPECT_DOUBLE_EQ(_metrics.latency.getLast(), 2'000.0); // in millis
+}
+
}
diff --git a/storage/src/tests/distributor/putoperationtest.cpp b/storage/src/tests/distributor/putoperationtest.cpp
index ff375e5b902..76b6741442e 100644
--- a/storage/src/tests/distributor/putoperationtest.cpp
+++ b/storage/src/tests/distributor/putoperationtest.cpp
@@ -73,7 +73,8 @@ public:
operation_context(),
getDistributorBucketSpace(),
msg,
- metrics().puts);
+ metrics().puts,
+ metrics().put_condition_probes);
op->start(_sender);
}
diff --git a/storage/src/tests/distributor/removeoperationtest.cpp b/storage/src/tests/distributor/removeoperationtest.cpp
index d352d23bb8c..d169c80a95d 100644
--- a/storage/src/tests/distributor/removeoperationtest.cpp
+++ b/storage/src/tests/distributor/removeoperationtest.cpp
@@ -41,7 +41,8 @@ struct RemoveOperationTest : Test, DistributorStripeTestUtil {
operation_context(),
getDistributorBucketSpace(),
msg,
- metrics().removes);
+ metrics().removes,
+ metrics().remove_condition_probes);
op->start(_sender);
}