public interface MetricsService
Modifier and Type | Method and Description |
---|---|
com.codahale.metrics.Counter |
createCounter(MetricsComponent component,
MetricsFeature feature,
String metricName)
Creates a Counter metric.
|
com.codahale.metrics.Histogram |
createHistogram(MetricsComponent component,
MetricsFeature feature,
String metricName)
Creates a Histogram metric.
|
com.codahale.metrics.Meter |
createMeter(MetricsComponent component,
MetricsFeature feature,
String metricName)
Creates a Meter metric.
|
com.codahale.metrics.Timer |
createTimer(MetricsComponent component,
MetricsFeature feature,
String metricName)
Creates a Timer metric.
|
Map<String,com.codahale.metrics.Counter> |
getCounters(com.codahale.metrics.MetricFilter filter)
Fetches the existing Counters.
|
Map<String,com.codahale.metrics.Gauge> |
getGauges(com.codahale.metrics.MetricFilter filter)
Fetches the existing Gauges.
|
Map<String,com.codahale.metrics.Histogram> |
getHistograms(com.codahale.metrics.MetricFilter filter)
Fetches the existing Histograms.
|
Map<String,com.codahale.metrics.Meter> |
getMeters(com.codahale.metrics.MetricFilter filter)
Fetches the existing Meters.
|
com.codahale.metrics.MetricRegistry |
getMetricRegistry()
Fetches existing metric registry.
|
Map<String,com.codahale.metrics.Metric> |
getMetrics()
Fetches the existing metrics.
|
Map<String,com.codahale.metrics.Timer> |
getTimers(com.codahale.metrics.MetricFilter filter)
Fetches the existing Timers.
|
void |
notifyReporters()
Notifies the changes on metric registry to all registered reporters.
|
MetricsComponent |
registerComponent(String name)
Registers a component.
|
<T extends com.codahale.metrics.Metric> |
registerMetric(MetricsComponent component,
MetricsFeature feature,
String metricName,
T metric)
Registers an already created Metric.
|
void |
registerReporter(MetricsReporter reporter)
Registers a reporter to receive any changes on metric registry.
|
void |
removeMatching(com.codahale.metrics.MetricFilter filter)
Removes all Metrics that match a given filter.
|
boolean |
removeMetric(MetricsComponent component,
MetricsFeature feature,
String metricName)
Removes the metric with the given name.
|
void |
unregisterReporter(MetricsReporter reporter)
Unregisters the given metric reporter.
|
MetricsComponent registerComponent(String name)
name
- name of the Component to registercom.codahale.metrics.MetricRegistry getMetricRegistry()
com.codahale.metrics.Counter createCounter(MetricsComponent component, MetricsFeature feature, String metricName)
component
- component the Counter is defined infeature
- feature the Counter is defined inmetricName
- local name of the metriccom.codahale.metrics.Histogram createHistogram(MetricsComponent component, MetricsFeature feature, String metricName)
component
- component the Histogram is defined infeature
- feature the Histogram is defined inmetricName
- local name of the metriccom.codahale.metrics.Timer createTimer(MetricsComponent component, MetricsFeature feature, String metricName)
component
- component the Timer is defined infeature
- feature the Timer is defined inmetricName
- local name of the metriccom.codahale.metrics.Meter createMeter(MetricsComponent component, MetricsFeature feature, String metricName)
component
- component the Meter is defined infeature
- feature the Meter is defined inmetricName
- local name of the metric<T extends com.codahale.metrics.Metric> T registerMetric(MetricsComponent component, MetricsFeature feature, String metricName, T metric)
T
- Metric typecomponent
- component the Metric is defined infeature
- feature the Metric is defined inmetricName
- local name of the metricmetric
- Metric to registervoid registerReporter(MetricsReporter reporter)
reporter
- metric reportervoid unregisterReporter(MetricsReporter reporter)
reporter
- metric reportervoid notifyReporters()
boolean removeMetric(MetricsComponent component, MetricsFeature feature, String metricName)
component
- component the Metric is defined infeature
- feature the Metric is defined inmetricName
- local name of the metricMap<String,com.codahale.metrics.Timer> getTimers(com.codahale.metrics.MetricFilter filter)
filter
- filter to use to select TimersMap<String,com.codahale.metrics.Gauge> getGauges(com.codahale.metrics.MetricFilter filter)
filter
- filter to use to select GaugesMap<String,com.codahale.metrics.Counter> getCounters(com.codahale.metrics.MetricFilter filter)
filter
- filter to use to select CountersMap<String,com.codahale.metrics.Meter> getMeters(com.codahale.metrics.MetricFilter filter)
filter
- filter to use to select MetersMap<String,com.codahale.metrics.Histogram> getHistograms(com.codahale.metrics.MetricFilter filter)
filter
- filter to use to select HistogramsMap<String,com.codahale.metrics.Metric> getMetrics()
void removeMatching(com.codahale.metrics.MetricFilter filter)
filter
- filter to use to select the Metrics to remove.