aboutsummaryrefslogtreecommitdiffstats
path: root/clustercontroller-utils
diff options
context:
space:
mode:
authorTor Brede Vekterli <vekterli@vespa.ai>2024-05-03 15:34:00 +0000
committerTor Brede Vekterli <vekterli@vespa.ai>2024-05-06 12:05:49 +0000
commitd0892bfdb01390b1196f22391760a844c8c37482 (patch)
treeeca994c2d66fcd4f5d1179b339eb51efe68b5017 /clustercontroller-utils
parent11252dce21f47a51570f24c6434ea99f9a0c11f8 (diff)
Emit single metric for how out of sync the cluster data is
With these changes the cluster controller continuously maintains a global aggregate across all content nodes that represents the number of pending and total buckets per bucket space. This aggregate can be sampled in O(1) time. An explicit metric `cluster-buckets-out-of-sync-ratio` has been added, and the value is also emitted as part of the cluster state REST API. Note: only emitted when statistics have been received from _all_ distributors for a particular cluster state, as it would otherwise potentially represent a state somewhere arbitrary between two or more distinct states.
Diffstat (limited to 'clustercontroller-utils')
-rw-r--r--clustercontroller-utils/src/main/java/com/yahoo/vespa/clustercontroller/utils/staterestapi/response/UnitMetrics.java2
-rw-r--r--clustercontroller-utils/src/test/java/com/yahoo/vespa/clustercontroller/utils/staterestapi/DummyStateApi.java4
2 files changed, 3 insertions, 3 deletions
diff --git a/clustercontroller-utils/src/main/java/com/yahoo/vespa/clustercontroller/utils/staterestapi/response/UnitMetrics.java b/clustercontroller-utils/src/main/java/com/yahoo/vespa/clustercontroller/utils/staterestapi/response/UnitMetrics.java
index f9876870873..f2c22b2dac5 100644
--- a/clustercontroller-utils/src/main/java/com/yahoo/vespa/clustercontroller/utils/staterestapi/response/UnitMetrics.java
+++ b/clustercontroller-utils/src/main/java/com/yahoo/vespa/clustercontroller/utils/staterestapi/response/UnitMetrics.java
@@ -5,6 +5,6 @@ import java.util.Map;
public interface UnitMetrics {
- Map<String, Long> getMetricMap();
+ Map<String, Number> getMetricMap();
}
diff --git a/clustercontroller-utils/src/test/java/com/yahoo/vespa/clustercontroller/utils/staterestapi/DummyStateApi.java b/clustercontroller-utils/src/test/java/com/yahoo/vespa/clustercontroller/utils/staterestapi/DummyStateApi.java
index a73e20b8755..9c39186855e 100644
--- a/clustercontroller-utils/src/test/java/com/yahoo/vespa/clustercontroller/utils/staterestapi/DummyStateApi.java
+++ b/clustercontroller-utils/src/test/java/com/yahoo/vespa/clustercontroller/utils/staterestapi/DummyStateApi.java
@@ -139,8 +139,8 @@ public class DummyStateApi implements StateRestAPI {
public UnitMetrics getMetrics() {
return new UnitMetrics() {
@Override
- public Map<String, Long> getMetricMap() {
- Map<String, Long> m = new LinkedHashMap<>();
+ public Map<String, Number> getMetricMap() {
+ Map<String, Number> m = new LinkedHashMap<>();
m.put("doc-count", (long) node.docCount);
return m;
}