public abstract class AbstractLatencyMetricsCollector<I extends LatencyMetricsIdentifier,E extends LatencyMetricsEvent> extends AbstractMetricsCollector implements LatencyMetricsCollector<I>
The default abstract implementation for a latency metrics collector.
Modifier | Constructor and Description |
---|---|
protected |
AbstractLatencyMetricsCollector(EventBus eventBus,
rx.Scheduler scheduler,
LatencyMetricsCollectorConfig config) |
Modifier and Type | Method and Description |
---|---|
LatencyMetricsCollectorConfig |
config()
Its high-level configuration.
|
protected CouchbaseEvent |
generateCouchbaseEvent()
Generate the actual
CouchbaseEvent to emit on every interval. |
protected abstract E |
generateLatencyMetricsEvent(Map<I,org.LatencyUtils.LatencyStats> latencyMetrics) |
void |
record(I identifier,
long latency)
Records a latency for the given identifier.
|
protected void |
remove(I identifier)
Helper method to remove an item out of the stored metrics.
|
boolean |
shutdown()
Shuts down the collector (non-reversible) and frees bound resources.
|
isEnabled, triggerEmit
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
isEnabled, triggerEmit
protected AbstractLatencyMetricsCollector(EventBus eventBus, rx.Scheduler scheduler, LatencyMetricsCollectorConfig config)
protected abstract E generateLatencyMetricsEvent(Map<I,org.LatencyUtils.LatencyStats> latencyMetrics)
protected CouchbaseEvent generateCouchbaseEvent()
AbstractMetricsCollector
Generate the actual CouchbaseEvent
to emit on every interval.
generateCouchbaseEvent
in class AbstractMetricsCollector
public void record(I identifier, long latency)
LatencyMetricsCollector
Records a latency for the given identifier.
record
in interface LatencyMetricsCollector<I extends LatencyMetricsIdentifier>
identifier
- the unique identifier to use.latency
- the latency to record for it.public boolean shutdown()
MetricsCollector
Shuts down the collector (non-reversible) and frees bound resources.
shutdown
in interface MetricsCollector
shutdown
in class AbstractMetricsCollector
public LatencyMetricsCollectorConfig config()
MetricsCollector
Its high-level configuration.
config
in interface LatencyMetricsCollector<I extends LatencyMetricsIdentifier>
config
in interface MetricsCollector
config
in class AbstractMetricsCollector
protected void remove(I identifier)
Helper method to remove an item out of the stored metrics.
Copyright © 2018 Couchbase, Inc.. All rights reserved.