com.netflix.servo.publish
Class MemoryMetricObserver

java.lang.Object
  extended by com.netflix.servo.publish.BaseMetricObserver
      extended by com.netflix.servo.publish.MemoryMetricObserver
All Implemented Interfaces:
MetricObserver

public final class MemoryMetricObserver
extends BaseMetricObserver

Keeps the last N observations in-memory.


Constructor Summary
MemoryMetricObserver()
          Creates a new instance that keeps 10 copies in memory.
MemoryMetricObserver(java.lang.String name, int num)
          Creates a new instance that keeps num copies in memory.
 
Method Summary
 java.util.List<java.util.List<Metric>> getObservations()
          Returns the current set of observations.
 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

MemoryMetricObserver

public MemoryMetricObserver()
Creates a new instance that keeps 10 copies in memory.


MemoryMetricObserver

public MemoryMetricObserver(java.lang.String name,
                            int num)
Creates a new instance that keeps num copies in memory.

Method Detail

updateImpl

public void updateImpl(java.util.List<Metric> metrics)
Update method that should be defined by sub-classes. This method will get invoked and counts will be maintained in the base observer.

Specified by:
updateImpl in class BaseMetricObserver

getObservations

public java.util.List<java.util.List<Metric>> getObservations()
Returns the current set of observations.