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 (java.lang.Object delegate)`

  - ### Methods Summary

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

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class java.lang.Object` | `java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()`

- - ### Constructor Detail

    - #### MetricsService(java.lang.Object delegate)

  - ### Method Detail

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

      Creates a metric service for a given Vertx instance.

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

    - #### java.lang.String getBaseName(Measured measured)

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

    - #### java.lang.Object getDelegate()

    - #### java.util.Map<java.lang.String, java.lang.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

    - #### java.util.Map<java.lang.String, java.lang.Object> getMetricsSnapshot(java.lang.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

    - #### java.util.Set<java.lang.String> metricsNames()

      Returns:
        the known metrics names by this service