use of com.yahoo.vespa.clustercontroller.utils.staterestapi.response.UnitResponse in project vespa by vespa-engine.
the class NodeTest method testRecursiveNode.
@Test
public void testRecursiveNode() throws Exception {
setUp(true);
UnitResponse response = restAPI.getState(new StateRequest("music/storage/1", 1));
String expected = "{\n" + " \"attributes\": {\"hierarchical-group\": \"east.g2\"},\n" + " \"state\": {\n" + " \"generated\": {\n" + " \"state\": \"up\",\n" + " \"reason\": \"\"\n" + " },\n" + " \"unit\": {\n" + " \"state\": \"up\",\n" + " \"reason\": \"\"\n" + " },\n" + " \"user\": {\n" + " \"state\": \"up\",\n" + " \"reason\": \"\"\n" + " }\n" + " },\n" + " \"partition\": {\n" + " \"0\": {\n" + " \"state\": {\"generated\": {\n" + " \"state\": \"up\",\n" + " \"reason\": \"\"\n" + " }},\n" + " \"metrics\": {\n" + " \"bucket-count\": 1,\n" + " \"unique-document-count\": 2,\n" + " \"unique-document-total-size\": 3\n" + " }\n" + " },\n" + " \"1\": {\n" + " \"state\": {\"generated\": {\n" + " \"state\": \"up\",\n" + " \"reason\": \"\"\n" + " }},\n" + " \"metrics\": {\n" + " \"bucket-count\": 1,\n" + " \"unique-document-count\": 2,\n" + " \"unique-document-total-size\": 3\n" + " }\n" + " }\n" + " }\n" + "}";
assertEquals(expected, jsonWriter.createJson(response).toString(2));
}
use of com.yahoo.vespa.clustercontroller.utils.staterestapi.response.UnitResponse in project vespa by vespa-engine.
the class PartitionTest method testRecursiveStorageClusterDoesNotIncludePartitionMetrics.
@Test
public void testRecursiveStorageClusterDoesNotIncludePartitionMetrics() throws Exception {
setUp(true);
UnitResponse response = restAPI.getState(new StateRequest("music/storage", 2));
String expected = "{\"state\": {\"generated\": {\n" + " \"state\": \"up\",\n" + " \"reason\": \"\"\n" + "}}}";
JSONObject json = jsonWriter.createJson(response);
assertEquals(expected, json.getJSONObject("node").getJSONObject("1").getJSONObject("partition").getJSONObject("0").toString(2));
}
use of com.yahoo.vespa.clustercontroller.utils.staterestapi.response.UnitResponse in project vespa by vespa-engine.
the class ServiceTest method testService.
@Test
public void testService() throws Exception {
setUp(true);
UnitResponse response = restAPI.getState(new StateRequest("music/distributor", 0));
String expected = "{\"node\": {\n" + " \"1\": {\"link\": \"\\/cluster\\/v2\\/music\\/distributor\\/1\"},\n" + " \"2\": {\"link\": \"\\/cluster\\/v2\\/music\\/distributor\\/2\"},\n" + " \"3\": {\"link\": \"\\/cluster\\/v2\\/music\\/distributor\\/3\"},\n" + " \"5\": {\"link\": \"\\/cluster\\/v2\\/music\\/distributor\\/5\"},\n" + " \"7\": {\"link\": \"\\/cluster\\/v2\\/music\\/distributor\\/7\"}\n" + "}}";
assertEquals(expected, jsonWriter.createJson(response).toString(2));
}
Aggregations