Commit 9b215df4 authored by Jon Schneider's avatar Jon Schneider Committed by Stephane Nicoll

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

parent 29b29e7d
...@@ -67,6 +67,11 @@ public class InfluxProperties extends StepRegistryProperties { ...@@ -67,6 +67,11 @@ public class InfluxProperties extends StepRegistryProperties {
*/ */
private Boolean compressed; 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() { public String getDb() {
return this.db; return this.db;
} }
...@@ -123,4 +128,11 @@ public class InfluxProperties extends StepRegistryProperties { ...@@ -123,4 +128,11 @@ public class InfluxProperties extends StepRegistryProperties {
this.compressed = compressed; this.compressed = compressed;
} }
public Boolean getAutoCreateDb() {
return this.autoCreateDb;
}
public void setAutoCreateDb(Boolean autoCreateDb) {
this.autoCreateDb = autoCreateDb;
}
} }
...@@ -70,4 +70,8 @@ class InfluxPropertiesConfigAdapter extends ...@@ -70,4 +70,8 @@ class InfluxPropertiesConfigAdapter extends
return get(InfluxProperties::getCompressed, InfluxConfig.super::compressed); return get(InfluxProperties::getCompressed, InfluxConfig.super::compressed);
} }
@Override
public boolean autoCreateDb() {
return get(InfluxProperties::getAutoCreateDb, InfluxConfig.super::autoCreateDb);
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment