Add influx property to govern whether db is auto-created or not

This commit is contained in:
Jon Schneider
2018-02-06 08:50:24 -06:00
committed by Stephane Nicoll
parent 29b29e7d3a
commit 9b215df4e9
2 changed files with 16 additions and 0 deletions

View File

@@ -67,6 +67,11 @@ public class InfluxProperties extends StepRegistryProperties {
*/
private Boolean compressed;
/**
* Check if Influx database exists before attempting to publish metrics to it, creating it if it does not exist.
*/
private Boolean autoCreateDb;
public String getDb() {
return this.db;
}
@@ -123,4 +128,11 @@ public class InfluxProperties extends StepRegistryProperties {
this.compressed = compressed;
}
public Boolean getAutoCreateDb() {
return this.autoCreateDb;
}
public void setAutoCreateDb(Boolean autoCreateDb) {
this.autoCreateDb = autoCreateDb;
}
}

View File

@@ -70,4 +70,8 @@ class InfluxPropertiesConfigAdapter extends
return get(InfluxProperties::getCompressed, InfluxConfig.super::compressed);
}
@Override
public boolean autoCreateDb() {
return get(InfluxProperties::getAutoCreateDb, InfluxConfig.super::autoCreateDb);
}
}