public abstract class BaseMetricObserver extends java.lang.Object implements MetricObserver
Constructor and Description |
---|
BaseMetricObserver(java.lang.String name)
Creates a new instance with a given name.
|
Modifier and Type | Method and Description |
---|---|
int |
getFailedUpdateCount()
Returns the number of times update failed with an exception.
|
java.lang.String |
getName()
Name associated with an observer.
|
int |
getUpdateCount()
Returns the total number of times update has been called.
|
protected void |
incrementFailedCount()
Can be used by sub-classes to increment the failed count if they handle
exception internally.
|
void |
update(java.util.List<Metric> metrics)
Invoked with the most recent values for a set of metrics.
|
abstract void |
updateImpl(java.util.List<Metric> metrics)
Update method that should be defined by sub-classes.
|
public BaseMetricObserver(java.lang.String name)
public abstract void updateImpl(java.util.List<Metric> metrics)
public final void update(java.util.List<Metric> metrics)
update
in interface MetricObserver
public final java.lang.String getName()
getName
in interface MetricObserver
protected final void incrementFailedCount()
public int getUpdateCount()
public int getFailedUpdateCount()