Search in sources :

Example 1 with IndexStats

use of org.sonar.server.es.response.IndexStats in project sonarqube by SonarSource.

the class EsIndexesSection method completeIndexAttributes.

private void completeIndexAttributes(ProtobufSystemInfo.Section.Builder protobuf) {
    IndicesStatsResponse indicesStats = esClient.indicesStats();
    for (IndexStats indexStats : indicesStats.getAllIndexStats()) {
        String prefix = "Index " + indexStats.getName() + " - ";
        setAttribute(protobuf, prefix + "Docs", indexStats.getDocCount());
        setAttribute(protobuf, prefix + "Shards", indexStats.getShardsCount());
        setAttribute(protobuf, prefix + "Store Size", humanReadableByteCountSI(indexStats.getStoreSizeBytes()));
    }
}
Also used : IndicesStatsResponse(org.sonar.server.es.response.IndicesStatsResponse) IndexStats(org.sonar.server.es.response.IndexStats)

Aggregations

IndexStats (org.sonar.server.es.response.IndexStats)1 IndicesStatsResponse (org.sonar.server.es.response.IndicesStatsResponse)1