Marvel: Add Cluster Stats timeout
Original commit: elastic/x-pack-elasticsearch@6a5631d124
This commit is contained in:
parent
5f932952f2
commit
e87b3d0681
|
@ -47,7 +47,7 @@ public class ClusterStatsCollector extends AbstractCollector<ClusterStatsCollect
|
||||||
protected Collection<MarvelDoc> doCollect() throws Exception {
|
protected Collection<MarvelDoc> doCollect() throws Exception {
|
||||||
ImmutableList.Builder<MarvelDoc> results = ImmutableList.builder();
|
ImmutableList.Builder<MarvelDoc> 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));
|
results.add(buildMarvelDoc(clusterName.value(), TYPE, System.currentTimeMillis(), clusterStatsResponse));
|
||||||
return results.build();
|
return results.build();
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,6 +38,10 @@ public class MarvelSettingsService extends AbstractComponent implements NodeSett
|
||||||
final TimeValueSetting clusterStateTimeout = MarvelSetting.timeSetting(CLUSTER_STATE_TIMEOUT, TimeValue.timeValueMinutes(10),
|
final TimeValueSetting clusterStateTimeout = MarvelSetting.timeSetting(CLUSTER_STATE_TIMEOUT, TimeValue.timeValueMinutes(10),
|
||||||
"Timeout value when collecting the cluster state (default to 10m)");
|
"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";
|
public static final String INDEX_RECOVERY_TIMEOUT = PREFIX + "index.recovery.timeout";
|
||||||
final TimeValueSetting recoveryTimeout = MarvelSetting.timeSetting(INDEX_RECOVERY_TIMEOUT, TimeValue.timeValueMinutes(10),
|
final TimeValueSetting recoveryTimeout = MarvelSetting.timeSetting(INDEX_RECOVERY_TIMEOUT, TimeValue.timeValueMinutes(10),
|
||||||
"Timeout value when collecting the recovery information (default to 10m)");
|
"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(indexStatsTimeout);
|
||||||
builder.add(indices);
|
builder.add(indices);
|
||||||
builder.add(clusterStateTimeout);
|
builder.add(clusterStateTimeout);
|
||||||
|
builder.add(clusterStatsTimeout);
|
||||||
builder.add(recoveryTimeout);
|
builder.add(recoveryTimeout);
|
||||||
builder.add(recoveryActiveOnly);
|
builder.add(recoveryActiveOnly);
|
||||||
this.settings = builder.build();
|
this.settings = builder.build();
|
||||||
|
@ -106,6 +111,10 @@ public class MarvelSettingsService extends AbstractComponent implements NodeSett
|
||||||
return clusterStateTimeout.getValue();
|
return clusterStateTimeout.getValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public TimeValue clusterStatsTimeout() {
|
||||||
|
return clusterStatsTimeout.getValue();
|
||||||
|
}
|
||||||
|
|
||||||
public TimeValue recoveryTimeout() {
|
public TimeValue recoveryTimeout() {
|
||||||
return recoveryTimeout.getValue();
|
return recoveryTimeout.getValue();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue