mirror of
https://github.com/nosqlbench/nosqlbench.git
synced 2024-12-26 00:31:07 -06:00
allow --docker-prom-retention-days with default of 183d
This commit is contained in:
parent
4a06f226c9
commit
0a6bb1fa5f
@ -135,7 +135,8 @@ public class NBCLI {
|
||||
DockerMetricsManager dmh = new DockerMetricsManager();
|
||||
Map<String, String> dashboardOptions = Map.of(
|
||||
DockerMetricsManager.GRAFANA_TAG, globalOptions.getDockerGrafanaTag(),
|
||||
DockerMetricsManager.PROM_TAG, globalOptions.getDockerPromTag()
|
||||
DockerMetricsManager.PROM_TAG, globalOptions.getDockerPromTag(),
|
||||
DockerMetricsManager.TSDB_RETENTION, String.valueOf(globalOptions.getDockerPromRetentionDays())
|
||||
);
|
||||
dmh.startMetrics(dashboardOptions);
|
||||
String warn = "Docker Containers are started, for grafana and prometheus, hit" +
|
||||
|
@ -87,6 +87,7 @@ public class NBCLIOptions {
|
||||
private final static String DOCKER_METRICS_AT = "--docker-metrics-at";
|
||||
private static final String DOCKER_GRAFANA_TAG = "--docker-grafana-tag";
|
||||
private static final String DOCKER_PROM_TAG = "--docker-prom-tag";
|
||||
private static final String DOCKER_PROM_RETENTION_DAYS = "--docker-prom-retention-days";
|
||||
|
||||
private static final String GRAALJS_ENGINE = "--graaljs";
|
||||
private static final String NASHORN_ENGINE = "--nashorn";
|
||||
@ -147,6 +148,7 @@ public class NBCLIOptions {
|
||||
private Path statepath;
|
||||
private final List<String> statePathAccesses = new ArrayList<>();
|
||||
private final String hdrForChartFileName = DEFAULT_CHART_HDR_LOG_NAME;
|
||||
private String dockerPromRetentionDays = "183d";
|
||||
|
||||
public String getAnnotatorsConfig() {
|
||||
return annotatorsConfig;
|
||||
@ -157,6 +159,10 @@ public class NBCLIOptions {
|
||||
return hdrForChartFileName;
|
||||
}
|
||||
|
||||
public String getDockerPromRetentionDays() {
|
||||
return this.dockerPromRetentionDays;
|
||||
}
|
||||
|
||||
public enum Mode {
|
||||
ParseGlobalsOnly,
|
||||
ParseAllOptions
|
||||
@ -288,6 +294,10 @@ public class NBCLIOptions {
|
||||
arglist.removeFirst();
|
||||
docker_prom_tag = readWordOrThrow(arglist, "prometheus docker tag");
|
||||
break;
|
||||
case DOCKER_PROM_RETENTION_DAYS:
|
||||
arglist.removeFirst();
|
||||
dockerPromRetentionDays = Integer.parseInt(readWordOrThrow(arglist, "prometheus retention days"));
|
||||
break;
|
||||
case DOCKER_GRAFANA_TAG:
|
||||
arglist.removeFirst();
|
||||
docker_grafana_tag = readWordOrThrow(arglist, "grafana docker tag");
|
||||
|
@ -30,6 +30,7 @@ public class DockerMetricsManager {
|
||||
|
||||
public static final String GRAFANA_TAG = "grafana_tag";
|
||||
public static final String PROM_TAG = "prom_tag";
|
||||
public static final String TSDB_RETENTION = "tsdb_days";
|
||||
|
||||
private final DockerHelper dh;
|
||||
|
||||
@ -45,7 +46,7 @@ public class DockerMetricsManager {
|
||||
|
||||
String ip = startGraphite();
|
||||
|
||||
startPrometheus(ip, options.get(PROM_TAG));
|
||||
startPrometheus(ip, options.get(PROM_TAG), options.get(TSDB_RETENTION));
|
||||
|
||||
startGrafana(ip, options.get(GRAFANA_TAG));
|
||||
|
||||
@ -94,7 +95,7 @@ public class DockerMetricsManager {
|
||||
}
|
||||
}
|
||||
|
||||
private void startPrometheus(String ip, String tag) {
|
||||
private void startPrometheus(String ip, String tag, String retention) {
|
||||
|
||||
logger.info("preparing to start docker metrics");
|
||||
String PROMETHEUS_IMG = "prom/prometheus";
|
||||
@ -117,7 +118,7 @@ public class DockerMetricsManager {
|
||||
List<String> cmdList = Arrays.asList(
|
||||
"--config.file=/etc/prometheus/prometheus.yml",
|
||||
"--storage.tsdb.path=/prometheus",
|
||||
"--storage.tsdb.retention=183d",
|
||||
"--storage.tsdb.retention=" + retention,
|
||||
"--web.enable-lifecycle"
|
||||
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user