Package io.vertx.micrometer
Class VertxInfluxDbOptions
- java.lang.Object
-
- io.vertx.micrometer.VertxInfluxDbOptions
-
public class VertxInfluxDbOptions extends Object
Vert.x InfluxDb micrometer configuration.- Author:
- Dan Kristensen, Joel Takvorian
-
-
Field Summary
Fields Modifier and Type Field Description static intDEFAULT_BATCH_SIZEDefault value for the maximum number of metrics in a batch = 10000.static booleanDEFAULT_COMPRESSION_ENABLEDThe default gzip enabled on InfluxDb = true.static intDEFAULT_CONNECT_TIMEOUTThe default connection timeout (seconds) = 1.static StringDEFAULT_DATABASEThe default InfluxDb database = default.static booleanDEFAULT_ENABLEDDefault value for enabled = false.static intDEFAULT_NUM_THREADSThe default number of threads used = 2.static intDEFAULT_READ_TIMEOUTThe default read timeout (seconds) = 10.static intDEFAULT_STEPDefault value for metric collection interval (in seconds) = 10.static StringDEFAULT_URIThe default InfluxDb server URI = http://localhost:8086.
-
Constructor Summary
Constructors Constructor Description VertxInfluxDbOptions()Create default options for InfluxDB reporting.VertxInfluxDbOptions(JsonObject json)Creates new options object for InfluxDB reporting fromjsoninput.VertxInfluxDbOptions(VertxInfluxDbOptions other)Creates new options object for InfluxDB reporting, which is a copy ofother.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetBatchSize()Get batch size, which is the maximum number of measurements sent per request to the InfluxDB server.StringgetBucket()intgetConnectTimeout()Get the connection timeout for InfluxDB server connections, in seconds.StringgetDb()Get the InfluxDB database name used to store metricsStringgetOrg()StringgetPassword()Get the password used for authenticated connectionsintgetReadTimeout()Get the read timeout for InfluxDB server connections, in seconds.StringgetRetentionPolicy()Get the InfluxDB retention policyintgetStep()Get the step of push intervals, in secondsStringgetToken()StringgetUri()Get the InfluxDB server URIStringgetUserName()Get the username used for authenticated connectionsbooleanisCompressed()Get the GZIP compression flag for requestsbooleanisEnabled()Will InfluxDB reporting be enabled?VertxInfluxDbOptionssetBatchSize(int batchSize)Maximum number of measurements sent per request to the InfluxDB server.VertxInfluxDbOptionssetBucket(String bucket)Specifies the destination bucket for writes.VertxInfluxDbOptionssetCompressed(boolean compressed)Activate or deactivate GZIP compression.VertxInfluxDbOptionssetConnectTimeout(int connectTimeout)Connection timeout for InfluxDB server connections, in seconds.VertxInfluxDbOptionssetDb(String db)Database name used to store metrics.VertxInfluxDbOptionssetEnabled(boolean enabled)Set true to enable InfluxDB reportingVertxInfluxDbOptionssetOrg(String org)Specifies the destination organization for writes.VertxInfluxDbOptionssetPassword(String password)Password used for authenticated connectionsVertxInfluxDbOptionssetReadTimeout(int readTimeout)Read timeout for InfluxDB server connections, in seconds.VertxInfluxDbOptionssetRetentionPolicy(String retentionPolicy)InfluxDB retention policyVertxInfluxDbOptionssetStep(int step)Push interval steps, in seconds.VertxInfluxDbOptionssetToken(String token)Authentication token for the InfluxDB API.VertxInfluxDbOptionssetUri(String uri)URI of the InfluxDB server.VertxInfluxDbOptionssetUserName(String userName)Username used for authenticated connectionsJsonObjecttoJson()io.micrometer.influx.InfluxConfigtoMicrometerConfig()Convert these options to a Micrometer'sInfluxConfigobject
-
-
-
Field Detail
-
DEFAULT_ENABLED
public static final boolean DEFAULT_ENABLED
Default value for enabled = false.- See Also:
- Constant Field Values
-
DEFAULT_STEP
public static final int DEFAULT_STEP
Default value for metric collection interval (in seconds) = 10.- See Also:
- Constant Field Values
-
DEFAULT_BATCH_SIZE
public static final int DEFAULT_BATCH_SIZE
Default value for the maximum number of metrics in a batch = 10000.- See Also:
- Constant Field Values
-
DEFAULT_URI
public static final String DEFAULT_URI
The default InfluxDb server URI = http://localhost:8086.- See Also:
- Constant Field Values
-
DEFAULT_DATABASE
public static final String DEFAULT_DATABASE
The default InfluxDb database = default.- See Also:
- Constant Field Values
-
DEFAULT_COMPRESSION_ENABLED
public static final boolean DEFAULT_COMPRESSION_ENABLED
The default gzip enabled on InfluxDb = true.- See Also:
- Constant Field Values
-
DEFAULT_NUM_THREADS
public static final int DEFAULT_NUM_THREADS
The default number of threads used = 2.- See Also:
- Constant Field Values
-
DEFAULT_CONNECT_TIMEOUT
public static final int DEFAULT_CONNECT_TIMEOUT
The default connection timeout (seconds) = 1.- See Also:
- Constant Field Values
-
DEFAULT_READ_TIMEOUT
public static final int DEFAULT_READ_TIMEOUT
The default read timeout (seconds) = 10.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
VertxInfluxDbOptions
public VertxInfluxDbOptions()
Create default options for InfluxDB reporting. Note that they are disabled by default.
-
VertxInfluxDbOptions
public VertxInfluxDbOptions(VertxInfluxDbOptions other)
Creates new options object for InfluxDB reporting, which is a copy ofother.
-
VertxInfluxDbOptions
public VertxInfluxDbOptions(JsonObject json)
Creates new options object for InfluxDB reporting fromjsoninput.
-
-
Method Detail
-
toJson
public JsonObject toJson()
- Returns:
- a JSON representation of these options
-
isEnabled
public boolean isEnabled()
Will InfluxDB reporting be enabled?- Returns:
- true if enabled, false if not.
-
setEnabled
public VertxInfluxDbOptions setEnabled(boolean enabled)
Set true to enable InfluxDB reporting
-
getUri
public String getUri()
Get the InfluxDB server URI
-
setUri
public VertxInfluxDbOptions setUri(String uri)
URI of the InfluxDB server. Example: http://influx:8086.
-
getDb
public String getDb()
Get the InfluxDB database name used to store metrics
-
setDb
public VertxInfluxDbOptions setDb(String db)
Database name used to store metrics. Default is "default".
-
getUserName
public String getUserName()
Get the username used for authenticated connections
-
setUserName
public VertxInfluxDbOptions setUserName(String userName)
Username used for authenticated connections
-
getPassword
public String getPassword()
Get the password used for authenticated connections
-
setPassword
public VertxInfluxDbOptions setPassword(String password)
Password used for authenticated connections
-
getRetentionPolicy
public String getRetentionPolicy()
Get the InfluxDB retention policy
-
setRetentionPolicy
public VertxInfluxDbOptions setRetentionPolicy(String retentionPolicy)
InfluxDB retention policy
-
isCompressed
public boolean isCompressed()
Get the GZIP compression flag for requests
-
setCompressed
public VertxInfluxDbOptions setCompressed(boolean compressed)
Activate or deactivate GZIP compression. It is activated by default.
-
getStep
public int getStep()
Get the step of push intervals, in seconds
-
setStep
public VertxInfluxDbOptions setStep(int step)
Push interval steps, in seconds. Default is 10 seconds.
-
getConnectTimeout
public int getConnectTimeout()
Get the connection timeout for InfluxDB server connections, in seconds.
-
setConnectTimeout
public VertxInfluxDbOptions setConnectTimeout(int connectTimeout)
Connection timeout for InfluxDB server connections, in seconds. Default is 1 second.
-
getReadTimeout
public int getReadTimeout()
Get the read timeout for InfluxDB server connections, in seconds.
-
setReadTimeout
public VertxInfluxDbOptions setReadTimeout(int readTimeout)
Read timeout for InfluxDB server connections, in seconds. Default is 10 seconds.
-
getBatchSize
public int getBatchSize()
Get batch size, which is the maximum number of measurements sent per request to the InfluxDB server.
-
setBatchSize
public VertxInfluxDbOptions setBatchSize(int batchSize)
Maximum number of measurements sent per request to the InfluxDB server. When the maximum is reached, several requests are made. Default is 10000.
-
getOrg
public String getOrg()
- Returns:
- the destination organization for writes
-
setOrg
public VertxInfluxDbOptions setOrg(String org)
Specifies the destination organization for writes. Takes either the ID or Name interchangeably. This is only used with InfluxDB v2.- Parameters:
org- the destination organization for writes- Returns:
- a reference to this, so the API can be used fluently
-
getBucket
public String getBucket()
- Returns:
- the destination bucket for writes
-
setBucket
public VertxInfluxDbOptions setBucket(String bucket)
Specifies the destination bucket for writes. Takes either the ID or Name interchangeably. This is only used with InfluxDB v2.- Parameters:
bucket- the destination bucket for writes- Returns:
- a reference to this, so the API can be used fluently
-
getToken
public String getToken()
- Returns:
- the authentication token for the InfluxDB API
-
setToken
public VertxInfluxDbOptions setToken(String token)
Authentication token for the InfluxDB API. This takes precedence over userName/password if configured.- Parameters:
token- the authentication token for the InfluxDB API- Returns:
- a reference to this, so the API can be used fluently
-
toMicrometerConfig
public io.micrometer.influx.InfluxConfig toMicrometerConfig()
Convert these options to a Micrometer'sInfluxConfigobject
-
-