Search in sources :

Example 1 with ClusterStatsRequestBuilder

use of org.elasticsearch.action.admin.cluster.stats.ClusterStatsRequestBuilder in project sonarqube by SonarSource.

the class ProxyClusterStatsRequestBuilderTest method trace_logs.

@Test
public void trace_logs() {
    logTester.setLevel(LoggerLevel.TRACE);
    ClusterStatsRequestBuilder requestBuilder = esTester.client().prepareClusterStats();
    requestBuilder.get();
    assertThat(logTester.logs()).hasSize(1);
}
Also used : ClusterStatsRequestBuilder(org.elasticsearch.action.admin.cluster.stats.ClusterStatsRequestBuilder) Test(org.junit.Test)

Example 2 with ClusterStatsRequestBuilder

use of org.elasticsearch.action.admin.cluster.stats.ClusterStatsRequestBuilder in project yacy_grid_mcp by yacy.

the class ElasticsearchClient method getClusterStatsNodes.

public ClusterStatsNodes getClusterStatsNodes() {
    ClusterStatsRequest clusterStatsRequest = new ClusterStatsRequestBuilder(elasticsearchClient.admin().cluster(), ClusterStatsAction.INSTANCE).request();
    ClusterStatsResponse clusterStatsResponse = elasticsearchClient.admin().cluster().clusterStats(clusterStatsRequest).actionGet();
    ClusterStatsNodes clusterStatsNodes = clusterStatsResponse.getNodesStats();
    return clusterStatsNodes;
}
Also used : ClusterStatsRequestBuilder(org.elasticsearch.action.admin.cluster.stats.ClusterStatsRequestBuilder) ClusterStatsRequest(org.elasticsearch.action.admin.cluster.stats.ClusterStatsRequest) ClusterStatsResponse(org.elasticsearch.action.admin.cluster.stats.ClusterStatsResponse) ClusterStatsNodes(org.elasticsearch.action.admin.cluster.stats.ClusterStatsNodes)

Example 3 with ClusterStatsRequestBuilder

use of org.elasticsearch.action.admin.cluster.stats.ClusterStatsRequestBuilder in project sonarqube by SonarSource.

the class ProxyClusterStatsRequestBuilderTest method stats.

@Test
public void stats() {
    ClusterStatsRequestBuilder requestBuilder = esTester.client().prepareClusterStats();
    requestBuilder.get();
}
Also used : ClusterStatsRequestBuilder(org.elasticsearch.action.admin.cluster.stats.ClusterStatsRequestBuilder) Test(org.junit.Test)

Example 4 with ClusterStatsRequestBuilder

use of org.elasticsearch.action.admin.cluster.stats.ClusterStatsRequestBuilder in project yacy_grid_mcp by yacy.

the class ElasticsearchClient method getStats.

/**
 * Retrieve a statistic object from the connected elasticsearch cluster
 *
 * @return cluster stats from connected cluster
 */
public ClusterStatsNodes getStats() {
    final ClusterStatsRequest clusterStatsRequest = new ClusterStatsRequestBuilder(elasticsearchClient.admin().cluster(), ClusterStatsAction.INSTANCE).request();
    final ClusterStatsResponse clusterStatsResponse = elasticsearchClient.admin().cluster().clusterStats(clusterStatsRequest).actionGet();
    final ClusterStatsNodes clusterStatsNodes = clusterStatsResponse.getNodesStats();
    return clusterStatsNodes;
}
Also used : ClusterStatsRequestBuilder(org.elasticsearch.action.admin.cluster.stats.ClusterStatsRequestBuilder) ClusterStatsRequest(org.elasticsearch.action.admin.cluster.stats.ClusterStatsRequest) ClusterStatsResponse(org.elasticsearch.action.admin.cluster.stats.ClusterStatsResponse) ClusterStatsNodes(org.elasticsearch.action.admin.cluster.stats.ClusterStatsNodes)

Aggregations

ClusterStatsRequestBuilder (org.elasticsearch.action.admin.cluster.stats.ClusterStatsRequestBuilder)4 ClusterStatsNodes (org.elasticsearch.action.admin.cluster.stats.ClusterStatsNodes)2 ClusterStatsRequest (org.elasticsearch.action.admin.cluster.stats.ClusterStatsRequest)2 ClusterStatsResponse (org.elasticsearch.action.admin.cluster.stats.ClusterStatsResponse)2 Test (org.junit.Test)2