use of org.graylog2.indexer.cluster.PendingTasksStats in project graylog2-server by Graylog2.
the class Cluster method elasticsearchStats.
public ElasticsearchStats elasticsearchStats() {
final List<String> indices = Arrays.asList(indexSetRegistry.getIndexWildcards());
final org.graylog2.system.stats.elasticsearch.ClusterStats clusterStats = clusterAdapter.clusterStats();
final PendingTasksStats pendingTasksStats = clusterAdapter.pendingTasks();
final ShardStats shardStats = clusterAdapter.shardStats(indices);
final org.graylog2.system.stats.elasticsearch.ClusterHealth clusterHealth = org.graylog2.system.stats.elasticsearch.ClusterHealth.from(shardStats, pendingTasksStats);
final HealthStatus healthStatus = clusterAdapter.health(indices).orElseThrow(() -> new IllegalStateException("Unable to retrieve cluster health."));
return ElasticsearchStats.create(clusterStats.clusterName(), clusterStats.clusterVersion(), healthStatus, clusterHealth, clusterStats.nodesStats(), clusterStats.indicesStats());
}
Aggregations