From e87b3d0681a1e2921ef03cb78963cd0837947e36 Mon Sep 17 00:00:00 2001 From: Tanguy Leroux Date: Wed, 5 Aug 2015 11:31:42 +0200 Subject: [PATCH] Marvel: Add Cluster Stats timeout Original commit: elastic/x-pack-elasticsearch@6a5631d124f0c6d891470e80c6175e757e90dace --- .../agent/collector/cluster/ClusterStatsCollector.java | 2 +- .../marvel/agent/settings/MarvelSettingsService.java | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/marvel/src/main/java/org/elasticsearch/marvel/agent/collector/cluster/ClusterStatsCollector.java b/marvel/src/main/java/org/elasticsearch/marvel/agent/collector/cluster/ClusterStatsCollector.java index 6ca2430e16e..6d413670049 100644 --- a/marvel/src/main/java/org/elasticsearch/marvel/agent/collector/cluster/ClusterStatsCollector.java +++ b/marvel/src/main/java/org/elasticsearch/marvel/agent/collector/cluster/ClusterStatsCollector.java @@ -47,7 +47,7 @@ public class ClusterStatsCollector extends AbstractCollector doCollect() throws Exception { ImmutableList.Builder results = ImmutableList.builder(); - ClusterStatsResponse clusterStatsResponse = client.admin().cluster().prepareClusterStats().get(); + ClusterStatsResponse clusterStatsResponse = client.admin().cluster().prepareClusterStats().get(marvelSettings.clusterStatsTimeout()); results.add(buildMarvelDoc(clusterName.value(), TYPE, System.currentTimeMillis(), clusterStatsResponse)); return results.build(); } diff --git a/marvel/src/main/java/org/elasticsearch/marvel/agent/settings/MarvelSettingsService.java b/marvel/src/main/java/org/elasticsearch/marvel/agent/settings/MarvelSettingsService.java index a0e8b8e5f37..54ae0b99051 100644 --- a/marvel/src/main/java/org/elasticsearch/marvel/agent/settings/MarvelSettingsService.java +++ b/marvel/src/main/java/org/elasticsearch/marvel/agent/settings/MarvelSettingsService.java @@ -38,6 +38,10 @@ public class MarvelSettingsService extends AbstractComponent implements NodeSett final TimeValueSetting clusterStateTimeout = MarvelSetting.timeSetting(CLUSTER_STATE_TIMEOUT, TimeValue.timeValueMinutes(10), "Timeout value when collecting the cluster state (default to 10m)"); + public static final String CLUSTER_STATS_TIMEOUT = PREFIX + "cluster.stats.timeout"; + final TimeValueSetting clusterStatsTimeout = MarvelSetting.timeSetting(CLUSTER_STATS_TIMEOUT, TimeValue.timeValueMinutes(10), + "Timeout value when collecting the cluster statistics (default to 10m)"); + public static final String INDEX_RECOVERY_TIMEOUT = PREFIX + "index.recovery.timeout"; final TimeValueSetting recoveryTimeout = MarvelSetting.timeSetting(INDEX_RECOVERY_TIMEOUT, TimeValue.timeValueMinutes(10), "Timeout value when collecting the recovery information (default to 10m)"); @@ -54,6 +58,7 @@ public class MarvelSettingsService extends AbstractComponent implements NodeSett builder.add(indexStatsTimeout); builder.add(indices); builder.add(clusterStateTimeout); + builder.add(clusterStatsTimeout); builder.add(recoveryTimeout); builder.add(recoveryActiveOnly); this.settings = builder.build(); @@ -106,6 +111,10 @@ public class MarvelSettingsService extends AbstractComponent implements NodeSett return clusterStateTimeout.getValue(); } + public TimeValue clusterStatsTimeout() { + return clusterStatsTimeout.getValue(); + } + public TimeValue recoveryTimeout() { return recoveryTimeout.getValue(); }