Class AbstractLatencyMetricsCollector<I extends LatencyMetricsIdentifier,E extends LatencyMetricsEvent>
- java.lang.Object
-
- com.couchbase.client.core.metrics.AbstractMetricsCollector
-
- com.couchbase.client.core.metrics.AbstractLatencyMetricsCollector<I,E>
-
- All Implemented Interfaces:
LatencyMetricsCollector<I>
,MetricsCollector
- Direct Known Subclasses:
NetworkLatencyMetricsCollector
public abstract class AbstractLatencyMetricsCollector<I extends LatencyMetricsIdentifier,E extends LatencyMetricsEvent> extends AbstractMetricsCollector implements LatencyMetricsCollector<I>
The default abstract implementation for a latency metrics collector.- Since:
- 1.2.0
- Author:
- Michael Nitschinger
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractLatencyMetricsCollector(EventBus eventBus, rx.Scheduler scheduler, LatencyMetricsCollectorConfig config)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description LatencyMetricsCollectorConfig
config()
Its high-level configuration.protected CouchbaseEvent
generateCouchbaseEvent()
Generate the actualCouchbaseEvent
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.-
Methods inherited from class com.couchbase.client.core.metrics.AbstractMetricsCollector
isEnabled, triggerEmit
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.couchbase.client.core.metrics.MetricsCollector
isEnabled, triggerEmit
-
-
-
-
Constructor Detail
-
AbstractLatencyMetricsCollector
protected AbstractLatencyMetricsCollector(EventBus eventBus, rx.Scheduler scheduler, LatencyMetricsCollectorConfig config)
-
-
Method Detail
-
generateLatencyMetricsEvent
protected abstract E generateLatencyMetricsEvent(Map<I,org.LatencyUtils.LatencyStats> latencyMetrics)
-
generateCouchbaseEvent
protected CouchbaseEvent generateCouchbaseEvent()
Description copied from class:AbstractMetricsCollector
Generate the actualCouchbaseEvent
to emit on every interval.- Specified by:
generateCouchbaseEvent
in classAbstractMetricsCollector
-
record
public void record(I identifier, long latency)
Description copied from interface:LatencyMetricsCollector
Records a latency for the given identifier.- Specified by:
record
in interfaceLatencyMetricsCollector<I extends LatencyMetricsIdentifier>
- Parameters:
identifier
- the unique identifier to use.latency
- the latency to record for it.
-
shutdown
public boolean shutdown()
Description copied from interface:MetricsCollector
Shuts down the collector (non-reversible) and frees bound resources.- Specified by:
shutdown
in interfaceMetricsCollector
- Overrides:
shutdown
in classAbstractMetricsCollector
-
config
public LatencyMetricsCollectorConfig config()
Description copied from interface:MetricsCollector
Its high-level configuration.- Specified by:
config
in interfaceLatencyMetricsCollector<I extends LatencyMetricsIdentifier>
- Specified by:
config
in interfaceMetricsCollector
- Overrides:
config
in classAbstractMetricsCollector
-
remove
protected void remove(I identifier)
Helper method to remove an item out of the stored metrics.
-
-