public class AggregatingMetricsService extends java.lang.Object implements MetricsService
MetricsService implementation, sending metrics to metrics aggregators by
defined routes.| Constructor and Description |
|---|
AggregatingMetricsService(AggregatorsRouter router,
MetricsIdentifierResolver resolver,
java.lang.String prefix) |
| Modifier and Type | Method and Description |
|---|---|
void |
createEvent(java.lang.String metricId,
int eventValue)
Creates event in time with eventValue for metricId.
|
void |
gauge(java.lang.String metricId,
int gaugeValue)
Increments gauge counter to gaugeValue for metric with id metricId
|
void |
increment(java.lang.String metricId,
int incrementValue)
Increments counter to incrementValue for metrics with id metricId
|
public AggregatingMetricsService(AggregatorsRouter router, MetricsIdentifierResolver resolver, java.lang.String prefix)
router - AggregatorRouter that defines list of aggregators accepting metric with defined nameresolver - metric name to identifier resolverprefix - prefix for metrics to be put before its name. Usually is configured for service to
separate it from other metrics in stackpublic void increment(java.lang.String metricId,
int incrementValue)
increment in interface MetricsServicemetricId - identifier of metricincrementValue - delta of incrementpublic void gauge(java.lang.String metricId,
int gaugeValue)
gauge in interface MetricsServicemetricId - identifier of metricgaugeValue - gauge valuepublic void createEvent(java.lang.String metricId,
int eventValue)
createEvent in interface MetricsServicemetricId - identifier of metriceventValue - logged event start time