public abstract class AggregatedMetricsCollectionService extends com.google.common.util.concurrent.AbstractScheduledService implements MetricsCollectionService
MetricsCollectionService which collect metrics through a set of cached
AggregatedMetricsEmitter.| Constructor and Description |
|---|
AggregatedMetricsCollectionService() |
| Modifier and Type | Method and Description |
|---|---|
protected ScheduledExecutorService |
executor() |
MetricsContext |
getContext(Map<String,String> tags) |
protected abstract void |
publish(Iterator<MetricValues> metrics)
Publishes the given collection of
MetricValues. |
protected void |
runOneIteration() |
protected com.google.common.util.concurrent.AbstractScheduledService.Scheduler |
scheduler() |
protected void |
shutDown() |
addListener, isRunning, start, startAndWait, startUp, state, stop, stopAndWait, toStringprotected abstract void publish(Iterator<MetricValues> metrics) throws Exception
MetricValues. When this method returns, the
given Iterator will no longer be valid. This method should process the input
iterator and returns quickly. Any long operations should be run in a separated thread.
This method is guaranteed not to get concurrent calls.metrics - collection of MetricValues to publish.Exception - if there is error raised during publish.protected final void runOneIteration()
throws Exception
runOneIteration in class com.google.common.util.concurrent.AbstractScheduledServiceExceptionprotected ScheduledExecutorService executor()
executor in class com.google.common.util.concurrent.AbstractScheduledServiceprotected com.google.common.util.concurrent.AbstractScheduledService.Scheduler scheduler()
scheduler in class com.google.common.util.concurrent.AbstractScheduledServicepublic final MetricsContext getContext(Map<String,String> tags)
getContext in interface MetricsCollectionServiceCopyright © 2015 Cask Data, Inc. Licensed under the Apache License, Version 2.0.