org.elasticsearch.action.admin.cluster.node.stats.NodesStatsRequestBuilder Java Examples

The following examples show how to use org.elasticsearch.action.admin.cluster.node.stats.NodesStatsRequestBuilder. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: Elasticsearch7SearchIndexTest.java    From vertexium with Apache License 2.0 5 votes vote down vote up
private long getNumQueries() {
    NodesStatsResponse nodeStats = new NodesStatsRequestBuilder(elasticsearchResource.getClient(), NodesStatsAction.INSTANCE).get();

    List<NodeStats> nodes = nodeStats.getNodes();
    assertEquals(1, nodes.size());

    SearchStats searchStats = nodes.get(0).getIndices().getSearch();
    return searchStats.getTotal().getQueryCount();
}
 
Example #2
Source File: AbstractClient.java    From Elasticsearch with Apache License 2.0 4 votes vote down vote up
@Override
public NodesStatsRequestBuilder prepareNodesStats(String... nodesIds) {
    return new NodesStatsRequestBuilder(this, NodesStatsAction.INSTANCE).setNodesIds(nodesIds);
}
 
Example #3
Source File: Elasticsearch7SearchIndexTest.java    From vertexium with Apache License 2.0 4 votes vote down vote up
private long getCurrentScrolls() {
    NodesStatsResponse nodeStats = new NodesStatsRequestBuilder(elasticsearchResource.getClient(), NodesStatsAction.INSTANCE).get();
    return nodeStats.getNodes().stream()
        .mapToLong(node -> node.getIndices().getSearch().getTotal().getScrollCurrent())
        .sum();
}
 
Example #4
Source File: ElasticsearchTransportClient.java    From Raigad with Apache License 2.0 4 votes vote down vote up
private NodesStatsRequestBuilder getNodeStatsRequestBuilder() {
    return nodeStatsRequestBuilder;
}
 
Example #5
Source File: ClusterAdminClient.java    From Elasticsearch with Apache License 2.0 2 votes vote down vote up
/**
 * Nodes stats of the cluster.
 */
NodesStatsRequestBuilder prepareNodesStats(String... nodesIds);