Class VertxInfluxDbOptions


  • public class VertxInfluxDbOptions
    extends Object
    Vert.x InfluxDb micrometer configuration.
    Author:
    Dan Kristensen, Joel Takvorian
    • 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 of other.
      • VertxInfluxDbOptions

        public VertxInfluxDbOptions​(JsonObject json)
        Creates new options object for InfluxDB reporting from json input.
    • 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
      • getDb

        public String getDb()
        Get the InfluxDB database name used to store metrics
      • getUserName

        public String getUserName()
        Get the username used for authenticated connections
      • getPassword

        public String getPassword()
        Get the password used for authenticated connections
      • getRetentionPolicy

        public String getRetentionPolicy()
        Get the 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.
      • getNumThreads

        @Deprecated
        public int getNumThreads()
        Deprecated.
        no longer used by Micrometer
        Get the number of threads used by the push scheduler.
      • setNumThreads

        @Deprecated
        public VertxInfluxDbOptions setNumThreads​(int numThreads)
        Deprecated.
        no longer used by Micrometer
        Number of threads to use by the push scheduler. Default is 2.
      • 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