Marvel: Be more precise about the required stats

Original commit: elastic/x-pack-elasticsearch@2a0385ea85
This commit is contained in:
Tanguy Leroux 2015-12-07 22:23:48 +01:00
parent fc321a02a1
commit d377168a7f
3 changed files with 16 additions and 3 deletions

View File

@ -53,9 +53,17 @@ public class IndexStatsCollector extends AbstractCollector<IndexStatsCollector>
List<MarvelDoc> results = new ArrayList<>(1);
try {
IndicesStatsResponse indicesStats = client.admin().indices().prepareStats()
.setRefresh(true)
.setIndices(marvelSettings.indices())
.setIndicesOptions(IndicesOptions.lenientExpandOpen())
.clear()
.setDocs(true)
.setFieldData(true)
.setIndexing(true)
.setMerge(true)
.setSearch(true)
.setSegments(true)
.setStore(true)
.setRefresh(true)
.get(marvelSettings.indexStatsTimeout());
long timestamp = System.currentTimeMillis();

View File

@ -54,7 +54,11 @@ public class IndicesStatsCollector extends AbstractCollector<IndicesStatsCollect
IndicesStatsResponse indicesStats = client.admin().indices().prepareStats()
.setIndices(marvelSettings.indices())
.setIndicesOptions(IndicesOptions.lenientExpandOpen())
.setRefresh(true)
.clear()
.setDocs(true)
.setIndexing(true)
.setSearch(true)
.setStore(true)
.get(marvelSettings.indicesStatsTimeout());
return Collections.singletonList(new IndicesStatsMarvelDoc(clusterUUID(), TYPE, System.currentTimeMillis(), indicesStats));

View File

@ -7,6 +7,7 @@ package org.elasticsearch.marvel.agent.collector.node;
import org.elasticsearch.action.admin.cluster.node.stats.NodeStats;
import org.elasticsearch.action.admin.indices.stats.CommonStatsFlags;
import org.elasticsearch.bootstrap.BootstrapInfo;
import org.elasticsearch.cluster.ClusterService;
import org.elasticsearch.cluster.node.DiscoveryNode;
@ -69,7 +70,7 @@ public class NodeStatsCollector extends AbstractCollector<NodeStatsCollector> {
protected Collection<MarvelDoc> doCollect() throws Exception {
List<MarvelDoc> results = new ArrayList<>(1);
NodeStats nodeStats = nodeService.stats();
NodeStats nodeStats = nodeService.stats(CommonStatsFlags.ALL, true, true, true, true, true, false, false, false,false, false);
// Here we are calling directly the DiskThresholdDecider to retrieve the high watermark value
// It would be nicer to use a settings API like documented in #6732