diff options
author | Jon Bratseth <bratseth@gmail.com> | 2023-03-06 14:54:24 +0100 |
---|---|---|
committer | Jon Bratseth <bratseth@gmail.com> | 2023-03-06 14:54:24 +0100 |
commit | 8cb9fcf7dca10cc430ccfec59995f980b52c9ce2 (patch) | |
tree | c38b2f80c9d4063412974869a92284d20a6cabe5 /node-repository | |
parent | 6679773bfbd7c9183b9a2815342dc2c5e1fd9b40 (diff) |
Always use 'last' suffix
Diffstat (limited to 'node-repository')
-rw-r--r-- | node-repository/src/test/java/com/yahoo/vespa/hosted/provision/maintenance/NodeMetricsDbMaintainerTest.java | 96 |
1 files changed, 50 insertions, 46 deletions
diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/maintenance/NodeMetricsDbMaintainerTest.java b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/maintenance/NodeMetricsDbMaintainerTest.java index d379513a8f9..c7c6e770fe3 100644 --- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/maintenance/NodeMetricsDbMaintainerTest.java +++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/maintenance/NodeMetricsDbMaintainerTest.java @@ -24,6 +24,7 @@ import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; /** + * @author bratseth */ public class NodeMetricsDbMaintainerTest { @@ -56,53 +57,56 @@ public class NodeMetricsDbMaintainerTest { private static class MockHttpClient implements MetricsV2MetricsFetcher.AsyncHttpClient { + // this value asserted on above final String cannedResponse = - "{\n" + - " \"nodes\": [\n" + - " {\n" + - " \"hostname\": \"host-1.yahoo.com\",\n" + - " \"role\": \"role0\",\n" + - " \"node\": {\n" + - " \"timestamp\": 1300,\n" + - " \"metrics\": [\n" + - " {\n" + - " \"values\": {\n" + - " \"cpu.util\": 14,\n" + // this value asserted on above - " \"mem_total.util\": 15,\n" + - " \"disk.util\": 20,\n" + - " \"application_generation\": 3,\n" + - " \"in_service\": 1\n" + - " },\n" + - " \"dimensions\": {\n" + - " \"state\": \"active\"\n" + - " }\n" + - " }\n" + - " ]\n" + - " }\n" + - " },\n" + - " {\n" + - " \"hostname\": \"host-2.yahoo.com\",\n" + - " \"role\": \"role0\",\n" + - " \"node\": {\n" + - " \"timestamp\": 1300,\n" + - " \"metrics\": [\n" + - " {\n" + - " \"values\": {\n" + - " \"cpu.util\": 1,\n" + - " \"mem_total.util\": 2,\n" + - " \"disk.util\": 3,\n" + - " \"application_generation\": 3,\n" + - " \"in_service\": 0\n" + - " },\n" + - " \"dimensions\": {\n" + - " \"state\": \"active\"\n" + - " }\n" + - " }\n" + - " ]\n" + - " }\n" + - " }\n" + - " ]\n" + - "}\n"; + """ + { + "nodes": [ + { + "hostname": "host-1.yahoo.com", + "role": "role0", + "node": { + "timestamp": 1300, + "metrics": [ + { + "values": { + "cpu.util": 14, + "mem_total.util": 15, + "disk.util": 20, + "application_generation.last": 3, + "in_service.last": 1 + }, + "dimensions": { + "state": "active" + } + } + ] + } + }, + { + "hostname": "host-2.yahoo.com", + "role": "role0", + "node": { + "timestamp": 1300, + "metrics": [ + { + "values": { + "cpu.util": 1, + "mem_total.util": 2, + "disk.util": 3, + "application_generation.last": 3, + "in_service.last": 0 + }, + "dimensions": { + "state": "active" + } + } + ] + } + } + ] + } + """; @Override public CompletableFuture<String> get(String url) { |