Search in sources :

Example 1 with PendingTasksStats

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());
}
Also used : ShardStats(org.graylog2.system.stats.elasticsearch.ShardStats) HealthStatus(org.graylog2.indexer.indices.HealthStatus)

Aggregations

HealthStatus (org.graylog2.indexer.indices.HealthStatus)1 ShardStats (org.graylog2.system.stats.elasticsearch.ShardStats)1