Interface MetricHistoryManager
public interface MetricHistoryManager
Created 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 SummaryFieldsModifier and TypeFieldDescriptionstatic final intstatic final int
- 
Method SummaryModifier and TypeMethodDescriptionhistoryAfterDate(String metricName, Date date) Returns all history for the metric that occurred after the specified date.historyAll(String metricName) Returns all history for the metric.historyInterpolated(String metricName, int density) Returns all available history for the metric in a compressed form.historyMostRecent(String metricName, int dataPoints) Returns the most recent X datapoints for the metric.booleanisRegistered(String metricName) voidvoidvoidregisterCounter(com.codahale.metrics.Counter counter, String counterPath) Registers the counter in both the GatewayContext metricRegistry and in this history manager.voidregisterCounter(com.codahale.metrics.Counter counter, 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<Double> gauge, String gaugePath) Registers the gauge in this history manager.voidregisterGauge(com.codahale.metrics.Gauge<Double> gauge, 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, String meterPath) Registers the meter in both the GatewayContext metricRegistry and in this history manager.voidregisterMeter(com.codahale.metrics.Meter meter, String meterPath, int pollRateMillis, int retainMinutes) Registers the counter in this history manager at the specified poll rate in milliseconds.voidstopRecording(String metricId) voidunregisterMetric(String metricPath) Removes the metric this history manager.
- 
Field Details- 
BASE_UPDATE_MILLISstatic final int BASE_UPDATE_MILLIS- See Also:
 
- 
BASE_RETAIN_MINUTESstatic final int BASE_RETAIN_MINUTES- See Also:
 
 
- 
- 
Method Details- 
record
- 
recordvoid record(String metricId, com.codahale.metrics.Metric metric, int pollRateMillis, int retainMinutes) 
- 
stopRecording
- 
registerGaugeRegisters 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<Double> gauge, 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
 
- 
registerCounterRegisters 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, 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
 
- 
registerMeterRegisters 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, 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.
- 
unregisterMetricRemoves 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.
 
- 
historyAllReturns all history for the metric. The list is sorted chronologically, where the most recent value is at the end of the list.- Throws:
- SQLException
 
- 
historyMostRecentReturns 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:
- SQLException
 
- 
historyInterpolatedReturns 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:
- SQLException
 
- 
historyAfterDateReturns all history for the metric that occurred after the specified date. Use to limit data to something like the last 24 hours.- Throws:
- SQLException
 
- 
isRegistered- Returns:
- true if the metric with the passed name is currently registered with the metric history system
 
 
-