|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.netflix.servo.publish.BaseMetricObserver
com.netflix.servo.publish.AsyncMetricObserver
public final class AsyncMetricObserver
Wraps another observer and asynchronously updates it in the background. The update call will always return immediately. If the queue fills up newer updates will overwrite older updates.
If an exception is thrown when calling update on wrapped observer it will be logged, but otherwise ignored.
| Constructor Summary | |
|---|---|
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. |
|
| Method Summary | |
|---|---|
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. |
| Methods inherited from class com.netflix.servo.publish.BaseMetricObserver |
|---|
getFailedUpdateCount, getName, getUpdateCount, incrementFailedCount, update |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
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 observer
public AsyncMetricObserver(java.lang.String name,
MetricObserver observer)
name - name of this observerobserver - a wrapped observer that will be updated asynchronously
public 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 dropped| Method Detail |
|---|
public void updateImpl(java.util.List<Metric> metrics)
updateImpl in class BaseMetricObserverpublic void stop()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||