# Class: MetricsService

## vertx-dropwizard-js/metrics_service~ MetricsService

#### new MetricsService()

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

Source:
  - vertx-dropwizard-js/metrics_service.js, line 31

### Methods

#### getBaseName(measured) → {string}

##### Parameters:

Name | Type | Description
--- | --- | ---
`measured` | Measured | the measure object

Source:
  - vertx-dropwizard-js/metrics_service.js, line 42

##### Returns:

the base name of the measured object

Type
  string

#### getMetricsSnapshot(baseName) → {Object}

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.

##### Parameters:

Name | Type | Description
--- | --- | ---
`baseName` | string |

Source:
  - vertx-dropwizard-js/metrics_service.js, line 72

##### Returns:

the map of metrics where the key is the name of the metric and the value is the json data representing that metric

Type
  Object

#### metricsNames() → {Array.<string>}

Source:
  - vertx-dropwizard-js/metrics_service.js, line 55

##### Returns:

the known metrics names by this service

Type
  Array.<string>