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 Details

    • DEFAULT_ENABLED

      public static final boolean DEFAULT_ENABLED
      Default value for enabled = false.
      See Also:
    • DEFAULT_STEP

      public static final int DEFAULT_STEP
      Default value for metric collection interval (in seconds) = 10.
      See Also:
    • DEFAULT_BATCH_SIZE

      public static final int DEFAULT_BATCH_SIZE
      Default value for the maximum number of metrics in a batch = 10000.
      See Also:
    • DEFAULT_URI

      public static final String DEFAULT_URI
      The default InfluxDb server URI = http://localhost:8086.
      See Also:
    • DEFAULT_DATABASE

      public static final String DEFAULT_DATABASE
      The default InfluxDb database = default.
      See Also:
    • DEFAULT_COMPRESSION_ENABLED

      public static final boolean DEFAULT_COMPRESSION_ENABLED
      The default gzip enabled on InfluxDb = true.
      See Also:
    • DEFAULT_NUM_THREADS

      public static final int DEFAULT_NUM_THREADS
      The default number of threads used = 2.
      See Also:
    • DEFAULT_CONNECT_TIMEOUT

      public static final int DEFAULT_CONNECT_TIMEOUT
      The default connection timeout (seconds) = 1.
      See Also:
    • DEFAULT_READ_TIMEOUT

      public static final int DEFAULT_READ_TIMEOUT
      The default read timeout (seconds) = 10.
      See Also:
  • Constructor Details

    • 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 of other.
    • VertxInfluxDbOptions

      public VertxInfluxDbOptions(JsonObject json)
      Creates new options object for InfluxDB reporting from json input.
  • Method Details

    • 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's InfluxConfig object