Package: io.vertx.groovy.ext.dropwizard

## [Groovy] Class MetricsService

- io.vertx.groovy.ext.dropwizard.MetricsService

- The metrics service mainly allows to return a snapshot of measured objects.

- - ### Constructor Summary

    Constructors
    Constructor and description
    `MetricsService (Object delegate)`

  - ### Methods Summary

    Methods
    Type | Name and description
    --- | ---
    `static MetricsService` | `create(Vertx vertx)` Creates a metric service for a given io.vertx.groovy.core.Vertx instance.
    `String` | `getBaseName(Measured measured)` @param measured the measure object
    `Object` | `getDelegate()`
    `Map<String, Object>` | `getMetricsSnapshot(Measured measured)` Will return the metrics that correspond with the `measured` object, null if no metrics is available.
    `Map<String, Object>` | `getMetricsSnapshot(String baseName)` Will return the metrics that begins with the `baseName`, null if no metrics is available.
    `Set<String>` | `metricsNames()` @return Returns: the known metrics names by this service

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class Object` | `wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll`

- - ### Constructor Detail

    - #### MetricsService(Object delegate)

  - ### Method Detail

    - #### static MetricsService create(Vertx vertx)

      Creates a metric service for a given io.vertx.groovy.core.Vertx instance.

      Returns:
        the metrics service
      Parameters:
        `vertx` - the vertx instance

    - #### String getBaseName(Measured measured)

      Returns:
        the base name of the measured object
      Parameters:
        `measured` - the measure object
        measured

    - #### Object getDelegate()

    - #### Map<String, Object> getMetricsSnapshot(Measured measured)

      Will return the metrics that correspond with the `measured` object, null if no metrics is available.

      Note: in the case of scaled servers, the JsonObject returns an aggregation of the metrics as the dropwizard backend reports to a single server.
      Returns:
        the map of metrics where the key is the name of the metric (excluding the base name unless for the Vert.x object) and the value is the json data representing that metric
      Parameters:
        measured

    - #### Map<String, Object> getMetricsSnapshot(String baseName)

      Will return the metrics that begins with the `baseName`, null if no metrics is available.

      Note: in the case of scaled servers, the JsonObject returns an aggregation of the metrics as the dropwizard backend reports to a single server.
      Returns:
        the map of metrics where the key is the name of the metric and the value is the json data representing that metric
      Parameters:
        baseName

    - #### Set<String> metricsNames()

      Returns:
        the known metrics names by this service