Class AbstractMetricsCollector
java.lang.Object
com.couchbase.client.core.metrics.AbstractMetricsCollector
- All Implemented Interfaces:
MetricsCollector
- Direct Known Subclasses:
AbstractLatencyMetricsCollector
,RuntimeMetricsCollector
public abstract class AbstractMetricsCollector extends Object implements MetricsCollector
A common base class for all metrics collectors which emit events.
- Since:
- 1.2.0
- Author:
- Michael Nitschinger
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractMetricsCollector(EventBus eventBus, rx.Scheduler scheduler, MetricsCollectorConfig config)
-
Method Summary
Modifier and Type Method Description MetricsCollectorConfig
config()
Its high-level configuration.protected abstract CouchbaseEvent
generateCouchbaseEvent()
Generate the actualCouchbaseEvent
to emit on every interval.boolean
isEnabled()
True if this collector actually emits something.boolean
shutdown()
Shuts down the collector (non-reversible) and frees bound resources.void
triggerEmit()
Triggers the immediate emission of whatever is currently collected.
-
Constructor Details
-
AbstractMetricsCollector
protected AbstractMetricsCollector(EventBus eventBus, rx.Scheduler scheduler, MetricsCollectorConfig config)
-
-
Method Details
-
generateCouchbaseEvent
Generate the actualCouchbaseEvent
to emit on every interval. -
config
Description copied from interface:MetricsCollector
Its high-level configuration.- Specified by:
config
in interfaceMetricsCollector
-
shutdown
public boolean shutdown()Description copied from interface:MetricsCollector
Shuts down the collector (non-reversible) and frees bound resources.- Specified by:
shutdown
in interfaceMetricsCollector
-
isEnabled
public boolean isEnabled()Description copied from interface:MetricsCollector
True if this collector actually emits something.- Specified by:
isEnabled
in interfaceMetricsCollector
-
triggerEmit
public void triggerEmit()Description copied from interface:MetricsCollector
Triggers the immediate emission of whatever is currently collected. Useful for testing.- Specified by:
triggerEmit
in interfaceMetricsCollector
-