use of org.sonar.server.es.response.ClusterStatsResponse in project sonarqube by SonarSource.
the class EsClient method clusterStats.
// https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-stats.html
public ClusterStatsResponse clusterStats() {
return execute(() -> {
Request request = new Request("GET", "/_cluster/stats");
Response response = restHighLevelClient.getLowLevelClient().performRequest(request);
return ClusterStatsResponse.toClusterStatsResponse(gson.fromJson(EntityUtils.toString(response.getEntity()), JsonObject.class));
});
}
use of org.sonar.server.es.response.ClusterStatsResponse in project sonarqube by SonarSource.
the class EsClusterStateSection method toProtobuf.
@Override
public ProtobufSystemInfo.Section toProtobuf() {
ProtobufSystemInfo.Section.Builder protobuf = ProtobufSystemInfo.Section.newBuilder();
protobuf.setName("Search State");
ClusterStatsResponse stats = esClient.clusterStats();
setAttribute(protobuf, "State", stats.getHealthStatus().name());
setAttribute(protobuf, "Nodes", stats.getNodeCount());
return protobuf.build();
}
Aggregations