summaryrefslogtreecommitdiffstats
path: root/clustercontroller-core
diff options
context:
space:
mode:
authorHåkon Hallingstad <hakon@verizonmedia.com>2020-01-17 16:21:22 +0100
committerHåkon Hallingstad <hakon@verizonmedia.com>2020-01-17 16:21:22 +0100
commite50ede25fe5f3a45badb59fa45023af0e2d3a01e (patch)
tree217d9af593422cbd247fdbc27e56859f78031c85 /clustercontroller-core
parentc28f13dac59167dee1257f5b23835e6441bc5f31 (diff)
Test metric value for different dimensions, and more
Diffstat (limited to 'clustercontroller-core')
-rw-r--r--clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/hostinfo/HostInfoTest.java11
-rw-r--r--clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/restapiv2/StateRestApiTest.java6
2 files changed, 12 insertions, 5 deletions
diff --git a/clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/hostinfo/HostInfoTest.java b/clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/hostinfo/HostInfoTest.java
index 696cfd42f5a..01fa926e610 100644
--- a/clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/hostinfo/HostInfoTest.java
+++ b/clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/hostinfo/HostInfoTest.java
@@ -59,9 +59,14 @@ public class HostInfoTest {
assertThat(metrics.get(3).getName(), equalTo("vds.datastored.bucket_space.buckets_total"));
assertThat(hostInfo.getClusterStateVersionOrNull(), is(123));
- Optional<Metrics.Value> value = hostInfo.getMetrics()
- .getValueAt("vds.datastored.bucket_space.buckets_total", Map.of("bucketSpace", "default"));
- assertThat(value.map(Metrics.Value::getLast), equalTo(Optional.of(129L)));
+ assertThat(hostInfo.getMetrics()
+ .getValueAt("vds.datastored.bucket_space.buckets_total", Map.of("bucketSpace", "default"))
+ .map(Metrics.Value::getLast),
+ equalTo(Optional.of(129L)));
+ assertThat(hostInfo.getMetrics()
+ .getValueAt("vds.datastored.bucket_space.buckets_total", Map.of("bucketSpace", "global"))
+ .map(Metrics.Value::getLast),
+ equalTo(Optional.of(0L)));
}
@Test
diff --git a/clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/restapiv2/StateRestApiTest.java b/clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/restapiv2/StateRestApiTest.java
index 44dcd50ae88..1370763a7c8 100644
--- a/clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/restapiv2/StateRestApiTest.java
+++ b/clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/restapiv2/StateRestApiTest.java
@@ -42,7 +42,8 @@ public abstract class StateRestApiTest {
{
Set<ConfiguredNode> nodes = FleetControllerTest.toNodes(0, 1, 2, 3);
ContentCluster cluster = new ContentCluster(
- "books", nodes, distribution, 6 /* minStorageNodesUp*/, 0.9, /* minRatioOfStorageNodesUp */true);
+ "books", nodes, distribution, 6 /* minStorageNodesUp*/, 0.9 /* minRatioOfStorageNodesUp */,
+ true /* determineBucketsFromBucketSpaceMetric */);
initializeCluster(cluster, nodes);
AnnotatedClusterState baselineState = AnnotatedClusterState.withoutAnnotations(ClusterState.stateFromString("distributor:4 storage:4"));
Map<String, AnnotatedClusterState> bucketSpaceStates = new HashMap<>();
@@ -56,7 +57,8 @@ public abstract class StateRestApiTest {
Set<ConfiguredNode> nodesInSlobrok = FleetControllerTest.toNodes(1, 3, 5, 7);
ContentCluster cluster = new ContentCluster(
- "music", nodes, distribution, 4 /* minStorageNodesUp*/, 0.0, /* minRatioOfStorageNodesUp */true);
+ "music", nodes, distribution, 4 /* minStorageNodesUp*/, 0.0 /* minRatioOfStorageNodesUp */,
+ true /* determineBucketsFromBucketSpaceMetric */);
if (dontInitializeNode2) {
// TODO: this skips initialization of node 2 to fake that it is not answering
// which really leaves us in an illegal state