Interface MetricHistoryManager
- 
 public interface MetricHistoryManagerCreated by mattgross on 3/15/2016. Defines the methods used to register a metric and retrieve a metric and its historical values from the internal system. Note that the internal system is NOT the internal database in /data/db.
- 
- 
Field SummaryFields Modifier and Type Field Description static intBASE_RETAIN_MINUTESstatic intBASE_UPDATE_MILLIS
 - 
Method SummaryAll Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.List<Datapoint>historyAfterDate(java.lang.String metricName, java.util.Date date)Returns all history for the metric that occurred after the specified date.java.util.List<Datapoint>historyAll(java.lang.String metricName)Returns all history for the metric.java.util.List<Datapoint>historyInterpolated(java.lang.String metricName, int density)Returns all available history for the metric in a compressed form.java.util.List<Datapoint>historyMostRecent(java.lang.String metricName, int dataPoints)Returns the most recent X datapoints for the metric.booleanisRegistered(java.lang.String metricName)voidrecord(java.lang.String metricId, com.codahale.metrics.Metric metric)voidrecord(java.lang.String metricId, com.codahale.metrics.Metric metric, int pollRateMillis, int retainMinutes)voidregisterCounter(com.codahale.metrics.Counter counter, java.lang.String counterPath)Registers the counter in both the GatewayContext metricRegistry and in this history manager.voidregisterCounter(com.codahale.metrics.Counter counter, java.lang.String counterPath, int pollRateMillis, int retainMinutes)Registers the counter in this history manager at the specified poll rate in milliseconds.voidregisterGauge(com.codahale.metrics.Gauge<java.lang.Double> gauge, java.lang.String gaugePath)Registers the gauge in this history manager.voidregisterGauge(com.codahale.metrics.Gauge<java.lang.Double> gauge, java.lang.String gaugePath, int pollRateMillis, int retainMinutes)Registers the gauge in this history manager at the specified poll rate in milliseconds.voidregisterMeter(com.codahale.metrics.Meter meter, java.lang.String meterPath)Registers the meter in both the GatewayContext metricRegistry and in this history manager.voidregisterMeter(com.codahale.metrics.Meter meter, java.lang.String meterPath, int pollRateMillis, int retainMinutes)Registers the counter in this history manager at the specified poll rate in milliseconds.voidstopRecording(java.lang.String metricId)voidunregisterMetric(java.lang.String metricPath)Removes the metric this history manager.
 
- 
- 
- 
Field Detail- 
BASE_UPDATE_MILLISstatic final int BASE_UPDATE_MILLIS - See Also:
- Constant Field Values
 
 - 
BASE_RETAIN_MINUTESstatic final int BASE_RETAIN_MINUTES - See Also:
- Constant Field Values
 
 
- 
 - 
Method Detail- 
recordvoid record(java.lang.String metricId, com.codahale.metrics.Metric metric)
 - 
recordvoid record(java.lang.String metricId, com.codahale.metrics.Metric metric, int pollRateMillis, int retainMinutes)
 - 
stopRecordingvoid stopRecording(java.lang.String metricId) 
 - 
registerGaugevoid registerGauge(com.codahale.metrics.Gauge<java.lang.Double> gauge, java.lang.String gaugePath)Registers the gauge in this history manager. After the gauge is registered, it is polled at the base update rate, and the polled value recorded in history. Values are retained for a few minutes (determined by the BASE_RETAIN_MINUTES value) and then are deleted from the internal database.- Parameters:
- gaugePath- the gauge can be retrieved at any time using this path
 
 - 
registerGaugevoid registerGauge(com.codahale.metrics.Gauge<java.lang.Double> gauge, java.lang.String gaugePath, int pollRateMillis, int retainMinutes)Registers the gauge in this history manager at the specified poll rate in milliseconds. The retainMinutes parameter determines the number of minutes to retain the value in history before it is deleted.- Parameters:
- gaugePath- the gauge can be retrieved at any time using this path
 
 - 
registerCountervoid registerCounter(com.codahale.metrics.Counter counter, java.lang.String counterPath)Registers the counter in both the GatewayContext metricRegistry and in this history manager. After the counter is registered, it is polled at the base update rate, and the polled value recorded in history. Values are retained for a few minutes (determined by the BASE_RETAIN_MINUTES value) and then are deleted from the internal database.- Parameters:
- counterPath- the counter can be retrieved at any time using this path
 
 - 
registerCountervoid registerCounter(com.codahale.metrics.Counter counter, java.lang.String counterPath, int pollRateMillis, int retainMinutes)Registers the counter in this history manager at the specified poll rate in milliseconds. The retainMinutes parameter determines the number of minutes to retain the value in the internal system before it is deleted.- Parameters:
- counterPath- the counter can be retrieved at any time using this path
 
 - 
registerMetervoid registerMeter(com.codahale.metrics.Meter meter, java.lang.String meterPath)Registers the meter in both the GatewayContext metricRegistry and in this history manager. After the meter is registered, it is polled at the base update rate, and the polled value recorded in history. The meter's one minute rate is used as the historical recorded value. Values are retained for a few minutes (determined by the BASE_RETAIN_MINUTES value) and then are deleted from the internal database.
 - 
registerMetervoid registerMeter(com.codahale.metrics.Meter meter, java.lang.String meterPath, int pollRateMillis, int retainMinutes)Registers the counter in this history manager at the specified poll rate in milliseconds. The meter's one minute rate is used as the historical recorded value. The retainMinutes parameter determines the number of minutes to retain the value in the internal system before it is deleted.
 - 
unregisterMetricvoid unregisterMetric(java.lang.String metricPath) Removes the metric this history manager. All records related to the metric will also be purged.- Parameters:
- metricPath- the path that was originally used to register the metric.
 
 - 
historyAlljava.util.List<Datapoint> historyAll(java.lang.String metricName) throws java.sql.SQLException Returns all history for the metric. The list is sorted chronologically, where the most recent value is at the end of the list.- Throws:
- java.sql.SQLException
 
 - 
historyMostRecentjava.util.List<Datapoint> historyMostRecent(java.lang.String metricName, int dataPoints) throws java.sql.SQLException Returns the most recent X datapoints for the metric. The list is sorted chronologically, where the most recent value is at the end of the list.- Parameters:
- dataPoints- the most recent X datapoints to return
- Throws:
- java.sql.SQLException
 
 - 
historyInterpolatedjava.util.List<Datapoint> historyInterpolated(java.lang.String metricName, int density) throws java.sql.SQLException Returns all available history for the metric in a compressed form. Use the density parameter to thin out the history and remove in-between points. A value of 1 includes all points. A value of 2 includes every other point, and a value of 4 includes every 4th point, etc.- Throws:
- java.sql.SQLException
 
 - 
historyAfterDatejava.util.List<Datapoint> historyAfterDate(java.lang.String metricName, java.util.Date date) throws java.sql.SQLException Returns all history for the metric that occurred after the specified date. Use to limit data to something like the last 24 hours.- Throws:
- java.sql.SQLException
 
 - 
isRegisteredboolean isRegistered(java.lang.String metricName) - Returns:
- true if the metric with the passed name is currently registered with the metric history system
 
 
- 
 
-