io.vertx.core.metrics

## Class MetricsOptions

- java.lang.Object
- - io.vertx.core.metrics.MetricsOptions

- Direct Known Subclasses:
    DropwizardMetricsOptions, MicrometerMetricsOptions

      public class MetricsOptions
      extends Object

  Vert.x metrics base configuration, this class can be extended by provider implementations to configure those specific implementations.
  Author:
    Julien Viet

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static boolean` | `DEFAULT_METRICS_ENABLED` The default value of metrics enabled false

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `MetricsOptions()` Default constructor
    `MetricsOptions(JsonObject json)` Create an instance from a `JsonObject`
    `MetricsOptions(MetricsOptions other)` Copy constructor

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `VertxMetricsFactory` | `getFactory()` Get the metrics factory to be used when metrics are enabled.
    `boolean` | `isEnabled()` Will metrics be enabled on the Vert.x instance?
    `MetricsOptions` | `setEnabled(boolean enable)` Set whether metrics will be enabled on the Vert.x instance.
    `MetricsOptions` | `setFactory(VertxMetricsFactory factory)` Programmatically set the metrics factory to be used when metrics are enabled.
    `JsonObject` | `toJson()`
    `String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### DEFAULT_METRICS_ENABLED

          public static final boolean DEFAULT_METRICS_ENABLED

      The default value of metrics enabled false
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### MetricsOptions

          public MetricsOptions()

      Default constructor

    - #### MetricsOptions

          public MetricsOptions(MetricsOptions other)

      Copy constructor
      Parameters:
        `other` - The other `MetricsOptions` to copy when creating this

    - #### MetricsOptions

          public MetricsOptions(JsonObject json)

      Create an instance from a `JsonObject`
      Parameters:
        `json` - the JsonObject to create it from

  - ### Method Detail

    - #### isEnabled

          public boolean isEnabled()

      Will metrics be enabled on the Vert.x instance?
      Returns:
        true if enabled, false if not.

    - #### setEnabled

          public MetricsOptions setEnabled(boolean enable)

      Set whether metrics will be enabled on the Vert.x instance.
      Parameters:
        `enable` - true if metrics enabled, or false if not.
      Returns:
        a reference to this, so the API can be used fluently

    - #### getFactory

          public VertxMetricsFactory getFactory()

      Get the metrics factory to be used when metrics are enabled.

      If the metrics factory has been programmatically set here, then that will be used when metrics are enabled for creating the `VertxMetrics` instance.

      Otherwise Vert.x attempts to locate a metrics factory implementation on the classpath.

      Returns:
        the metrics factory

    - #### setFactory

          public MetricsOptions setFactory(VertxMetricsFactory factory)

      Programmatically set the metrics factory to be used when metrics are enabled.

      Only valid if `isEnabled()` = true.

      Normally Vert.x will look on the classpath for a metrics factory implementation, but if you want to set one programmatically you can use this method.

      Parameters:
        `factory` - the metrics factory
      Returns:
        a reference to this, so the API can be used fluently

    - #### toJson

          public JsonObject toJson()

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

Copyright © 2022 Eclipse. All rights reserved.