public final class AsyncMetricObserver extends BaseMetricObserver
Constructor and Description |
---|
AsyncMetricObserver(java.lang.String name,
MetricObserver observer)
Creates a new instance with an unbounded queue and no expiration time.
|
AsyncMetricObserver(java.lang.String name,
MetricObserver observer,
int queueSize)
Creates a new instance with no expiration time.
|
AsyncMetricObserver(java.lang.String name,
MetricObserver observer,
int queueSize,
long expireTime)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
void |
stop()
Stop the background thread that pushes updates to the wrapped observer.
|
void |
updateImpl(java.util.List<Metric> metrics)
Update method that should be defined by sub-classes.
|
getFailedUpdateCount, getName, getUpdateCount, incrementFailedCount, update
public AsyncMetricObserver(java.lang.String name, MetricObserver observer, int queueSize, long expireTime)
name
- name of this observerobserver
- a wrapped observer that will be updated asynchronouslyqueueSize
- maximum size of the update queue, if the queue fills
up older entries will be droppedexpireTime
- age in milliseconds before an update expires and will
not be passed on to the wrapped observerpublic AsyncMetricObserver(java.lang.String name, MetricObserver observer)
name
- name of this observerobserver
- a wrapped observer that will be updated asynchronouslypublic AsyncMetricObserver(java.lang.String name, MetricObserver observer, int queueSize)
name
- name of this observerobserver
- a wrapped observer that will be updated asynchronouslyqueueSize
- maximum size of the update queue, if the queue fills
up older entries will be droppedpublic void updateImpl(java.util.List<Metric> metrics)
updateImpl
in class BaseMetricObserver
public void stop()