@Test public void to_string() { assertThat(es.client().prepareNodesStats().setNodesIds("node1").toString()).isEqualTo("ES nodes stats request on nodes 'node1'"); assertThat(es.client().prepareNodesStats().toString()).isEqualTo("ES nodes stats request"); }
public Collection<NodeInfo> load() { NodesStatsResponse nodesStats = esClient.prepareNodesStats() .setFs(true) .setProcess(true) .setJvm(true) .setIndices(true) .setBreaker(true) .get(); List<NodeInfo> result = new ArrayList<>(); nodesStats.getNodes().forEach(nodeStat -> result.add(toNodeInfo(nodeStat))); return result; }
private void completeNodeAttributes(ProtobufSystemInfo.Section.Builder protobuf) { NodesStatsResponse nodesStats = esClient.prepareNodesStats() .setFs(true) .setProcess(true) .setJvm(true) .setIndices(true) .setBreaker(true) .get(); if (!nodesStats.getNodes().isEmpty()) { NodeStats stats = nodesStats.getNodes().get(0); toProtobuf(stats, protobuf); } }
@Test public void stats() { es.client().prepareNodesStats().get(); }
@Test public void trace_logs() { logTester.setLevel(LoggerLevel.TRACE); es.client().prepareNodesStats().get(); assertThat(logTester.logs()).hasSize(1); }
@Test public void get_with_string_timeout_is_not_yet_implemented() { thrown.expect(IllegalStateException.class); thrown.expectMessage("Not yet implemented"); es.client().prepareNodesStats(FakeIndexDefinition.INDEX).get("1"); }
@Test public void execute_should_throw_an_unsupported_operation_exception() { thrown.expect(UnsupportedOperationException.class); thrown.expectMessage("execute() should not be called as it's used for asynchronous"); es.client().prepareNodesStats(FakeIndexDefinition.INDEX).execute(); }
@Test public void proxify_requests() { EsClient underTest = es.client(); assertThat(underTest.nativeClient()).isNotNull(); assertThat(underTest.prepareClusterStats()).isInstanceOf(ProxyClusterStatsRequestBuilder.class); assertThat(underTest.prepareCreate("fakes")).isInstanceOf(ProxyCreateIndexRequestBuilder.class); assertThat(underTest.prepareDelete("fakes", "fake", "my_id")).isInstanceOf(ProxyDeleteRequestBuilder.class); assertThat(underTest.prepareIndicesExist()).isInstanceOf(ProxyIndicesExistsRequestBuilder.class); assertThat(underTest.prepareGet(new IndexType("fakes", "fake"), "1")).isInstanceOf(ProxyGetRequestBuilder.class); assertThat(underTest.prepareHealth()).isInstanceOf(ProxyClusterHealthRequestBuilder.class); assertThat(underTest.prepareNodesStats()).isInstanceOf(ProxyNodesStatsRequestBuilder.class); assertThat(underTest.preparePutMapping()).isInstanceOf(ProxyPutMappingRequestBuilder.class); assertThat(underTest.prepareRefresh()).isInstanceOf(ProxyRefreshRequestBuilder.class); assertThat(underTest.prepareSearch(new IndexType[0])).isInstanceOf(ProxySearchRequestBuilder.class); assertThat(underTest.prepareSearchScroll("1234")).isInstanceOf(ProxySearchScrollRequestBuilder.class); assertThat(underTest.prepareState()).isInstanceOf(ProxyClusterStateRequestBuilder.class); assertThat(underTest.prepareStats()).isInstanceOf(ProxyIndicesStatsRequestBuilder.class); underTest.close(); } }
@Test public void get_with_time_value_timeout_is_not_yet_implemented() { thrown.expect(IllegalStateException.class); thrown.expectMessage("Not yet implemented"); es.client().prepareNodesStats(FakeIndexDefinition.INDEX).get(TimeValue.timeValueMinutes(1)); }
public Collection<NodeInfo> load() { NodesStatsResponse nodesStats = esClient.prepareNodesStats() .setFs(true) .setProcess(true) .setJvm(true) .setIndices(true) .setBreaker(true) .get(); List<NodeInfo> result = new ArrayList<>(); nodesStats.getNodes().forEach(nodeStat -> result.add(toNodeInfo(nodeStat))); return result; }
private void completeNodeAttributes(ProtobufSystemInfo.Section.Builder protobuf) { NodesStatsResponse nodesStats = esClient.prepareNodesStats() .setFs(true) .setProcess(true) .setJvm(true) .setIndices(true) .setBreaker(true) .get(); if (!nodesStats.getNodes().isEmpty()) { NodeStats stats = nodesStats.getNodes().get(0); toProtobuf(stats, protobuf); } }