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);
}
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;
}
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();
}
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;
}
Aggregations