Add influx property to govern whether db is auto-created or not
This commit is contained in:
committed by
Stephane Nicoll
parent
29b29e7d3a
commit
9b215df4e9
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user