com.netflix.servo.publish
Class FileMetricObserver

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

public final class FileMetricObserver
extends BaseMetricObserver

Writes observations to a file. The format is a basic text file with tabs separating the fields.


Constructor Summary
FileMetricObserver(java.lang.String name, java.io.File dir)
          Creates a new instance that stores files in dir with a prefix of name and a suffix of a timestamp in the format yyyy_dd_MM_HH_mm_ss_SSS.
FileMetricObserver(java.lang.String name, java.io.File dir, boolean compress)
          Creates a new instance that stores files in dir with a prefix of name and a suffix of a timestamp in the format yyyy_dd_MM_HH_mm_ss_SSS.
FileMetricObserver(java.lang.String name, java.lang.String namePattern, java.io.File dir, boolean compress)
          Creates a new instance that stores files in dir with a name that is created using namePattern.
 
Method Summary
 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

FileMetricObserver

public FileMetricObserver(java.lang.String name,
                          java.io.File dir)
Creates a new instance that stores files in dir with a prefix of name and a suffix of a timestamp in the format yyyy_dd_MM_HH_mm_ss_SSS.

Parameters:
name - name to use as a prefix on files
dir - directory where observations will be stored

FileMetricObserver

public FileMetricObserver(java.lang.String name,
                          java.io.File dir,
                          boolean compress)
Creates a new instance that stores files in dir with a prefix of name and a suffix of a timestamp in the format yyyy_dd_MM_HH_mm_ss_SSS.

Parameters:
name - name to use as a prefix on files
dir - directory where observations will be stored
compress - whether to compress our output

FileMetricObserver

public FileMetricObserver(java.lang.String name,
                          java.lang.String namePattern,
                          java.io.File dir,
                          boolean compress)
Creates a new instance that stores files in dir with a name that is created using namePattern.

Parameters:
name - name of the observer
namePattern - date format pattern used to create the file names
dir - directory where observations will be stored
compress - whether to compress our output
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