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); } }
@Override public NodesStatsResponse newResponse() { return new NodesStatsResponse(); }
@Override public String toString() { try { XContentBuilder builder = XContentFactory.jsonBuilder().prettyPrint(); builder.startObject(); toXContent(builder, EMPTY_PARAMS); builder.endObject(); return Strings.toString(builder); } catch (IOException e) { return "{ \"error\" : \"" + e.getMessage() + "\"}"; } } }
for (final NodeStats nodeStats : nodesStats.getNodes()) { for (final ThreadPoolStats.Stats threadPoolStats : nodeStats.getThreadPool()) { candidates.add(threadPoolStats.getName()); final NodeStats stats = nodesStats.getNodesMap().get(node.getId());
public Map<String, NodeStats> getNodesStats() throws Exception { NodesStatsResponse nodesStats = esClient.admin().cluster().prepareNodesStats().all().get(); return nodesStats.getNodesMap(); }
for (final NodeStats nodeStats : nodesStats.getNodes()) { for (final ThreadPoolStats.Stats threadPoolStats : nodeStats.getThreadPool()) { candidates.add(threadPoolStats.getName()); final NodeStats stats = nodesStats.getNodesMap().get(node.getId());
private Map<String, NodeStats> fetchNodeStats() { ClusterAdminClient adminClient = this.client.admin().cluster(); NodesStatsResponse nodesStatsResponse = adminClient.nodesStats(adminClient.prepareNodesStats().request()).actionGet(); return nodesStatsResponse.getNodesMap(); } }
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; }
for (final NodeStats nodeStats : nodesStats.getNodes()) { for (final ThreadPoolStats.Stats threadPoolStats : nodeStats.getThreadPool()) { candidates.add(threadPoolStats.getName()); final NodeStats stats = nodesStats.getNodesMap().get(node.getId());
NodeStats stats = nodesStats.getNodesMap().get(node.getId());
@Override protected NodesStatsResponse newResponse(NodesStatsRequest request, List<NodeStats> responses, List<FailedNodeException> failures) { return new NodesStatsResponse(clusterService.getClusterName(), responses, failures); }
@Override public String toString() { try { XContentBuilder builder = XContentFactory.jsonBuilder().prettyPrint(); builder.startObject(); toXContent(builder, EMPTY_PARAMS); builder.endObject(); return builder.string(); } catch (IOException e) { return "{ \"error\" : \"" + e.getMessage() + "\"}"; } } }
private boolean isBulkProcessorAvailable() { NodesStatsResponse response = client.admin().cluster().prepareNodesStats().setThreadPool(true).get(); for (NodeStats nodeStats : response.getNodes()) { Iterator<Stats> iterator = nodeStats.getThreadPool().iterator(); while (iterator.hasNext()) { Stats stats = iterator.next(); if ("bulk".equals(stats.getName())) { int queue = stats.getQueue(); logger.trace("bulkQueueSize [{}] - queue [{}] - availability [{}]", bulkQueueSize, queue, 1 - (queue / bulkQueueSize)); return 1 - (queue / bulkQueueSize) > 0.1; } } } return true; }
for (final NodeStats nodeStats : nodesStats.getNodes()) { for (final ThreadPoolStats.Stats threadPoolStats : nodeStats.getThreadPool()) { candidates.add(threadPoolStats.getName()); final NodeStats stats = nodesStats.getNodesMap().get(node.getId());
NodeStats stats = nodesStats.getNodesMap().get(node.id()); table.startRow();
@Override public NodesStatsResponse newResponse() { return new NodesStatsResponse(); }