public interface MetricsRetriever
Modifier and Type | Method and Description |
---|---|
String |
createCsvData(String rrdFilename,
long startTime,
long endTime)
Retrieves the metric's data as a CSV (Comma Separated Values) formatted string from the
specified RRD file over the specified time range.
|
byte[] |
createGraph(String metricName,
String rrdFilename,
long startTime,
long endTime)
Retrieves the PNG-formatted graph of the metric's data from the specified RRD file over the
specified time range.
|
byte[] |
createGraph(String metricName,
String rrdFilename,
long startTime,
long endTime,
String verticalAxisLabel,
String title)
Retrieves the PNG-formatted graph of the metric's data from the specified RRD file over the
specified time range, using the input y-axis label and title on the graph that is generated.
|
String |
createJsonData(String metricName,
String rrdFilename,
long startTime,
long endTime)
Retrieves the metric's data as a JSON formatted string from the specified RRD file over the
specified time range.
|
OutputStream |
createPptData(String metricName,
String rrdFilename,
long startTime,
long endTime)
Retrieves the metric's data as a PPT (PowerPoint) formatted stream from the specified RRD file
over the specified time range.
|
OutputStream |
createPptReport(List<String> metricNames,
String metricsDir,
long startTime,
long endTime)
Returns a PPT (PowerPoint) formatted stream over the specified time range that contains one
slide for each metric.
|
OutputStream |
createXlsData(String metricName,
String rrdFilename,
long startTime,
long endTime)
Retrieves the metric's data as an XLS (Excel spreadsheet) formatted stream from the specified
RRD file over the specified time range.
|
OutputStream |
createXlsReport(List<String> metricNames,
String metricsDir,
long startTime,
long endTime,
String summaryInterval)
Returns an XLS (Excel spreadsheet) formatted stream over the specified time range that contains
one worksheet for each metric.
|
String |
createXmlData(String metricName,
String rrdFilename,
long startTime,
long endTime)
Retrieves the metric's data as an XML formatted string from the specified RRD file over the
specified time range.
|
byte[] createGraph(String metricName, String rrdFilename, long startTime, long endTime) throws IOException, MetricsGraphException
metricName
- name of the metric to be graphedrrdFilename
- name of the RRD file to retrieve the metric's data fromstartTime
- start time, in seconds since Unix epoch, to retrieve metric's dataendTime
- end time, in seconds since Unix epoch, to retrieve metric's dataIOException
MetricsGraphException
byte[] createGraph(String metricName, String rrdFilename, long startTime, long endTime, String verticalAxisLabel, String title) throws IOException, MetricsGraphException
metricName
- name of the metric to be graphedrrdFilename
- name of the RRD file to retrieve the metric's data fromstartTime
- start time, in seconds since Unix epoch, to retrieve metric's dataendTime
- end time, in seconds since Unix epoch, to retrieve metric's dataverticalAxisLabel
- label to use for the vertical (y) axistitle
- the title to use for the graphIOException
MetricsGraphException
String createCsvData(String rrdFilename, long startTime, long endTime) throws IOException, MetricsGraphException
rrdFilename
- name of the RRD file to retrieve the metric's data fromstartTime
- start time, in seconds since Unix epoch, to retrieve metric's dataendTime
- end time, in seconds since Unix epoch, to retrieve metric's dataIOException
MetricsGraphException
String createXmlData(String metricName, String rrdFilename, long startTime, long endTime) throws IOException, MetricsGraphException
The format of this XML string will be:
<metricName>
<title>metricName for startTime to endTime</title>
<data>
<sample>
<timestamp>MMM DD YYY hh:mm:ss</timestamp>
<value>12345</value>
</sample>
<sample>
...
</sample>
<totalCount>99999</totalCount>
</data>
</metricName>
Note that metricName
- name of the metric to retrieve data forrrdFilename
- name of the RRD file to retrieve the metric's data fromstartTime
- start time, in seconds since Unix epoch, to retrieve metric's dataendTime
- end time, in seconds since Unix epoch, to retrieve metric's dataIOException
MetricsGraphException
OutputStream createXlsData(String metricName, String rrdFilename, long startTime, long endTime) throws IOException, MetricsGraphException
metricName
- name of the metric to retrieve data forrrdFilename
- name of the RRD file to retrieve the metric's data fromstartTime
- start time, in seconds since Unix epoch, to retrieve metric's dataendTime
- end time, in seconds since Unix epoch, to retrieve metric's dataIOException
MetricsGraphException
OutputStream createPptData(String metricName, String rrdFilename, long startTime, long endTime) throws IOException, MetricsGraphException
metricName
- name of the metric to retrieve data forrrdFilename
- name of the RRD file to retrieve the metric's data fromstartTime
- start time, in seconds since Unix epoch, to retrieve metric's dataendTime
- end time, in seconds since Unix epoch, to retrieve metric's dataIOException
MetricsGraphException
String createJsonData(String metricName, String rrdFilename, long startTime, long endTime) throws IOException, MetricsGraphException
The format of this JSON string will be (data values in this sample are notional):
{
"title":"catalogQueries for Apr 10 2013 10:18:05 to Apr 10 2013 10:33:05",
"totalCount":5348,
"data":[
{
"timestamp":"Apr 10 2013 10:18:00",
"value":351
},
{
"timestamp":"Apr 10 2013 10:19:00",
"value":358
},
]
}
Note that metricName
- name of the metric to retrieve data forrrdFilename
- name of the RRD file to retrieve the metric's data fromstartTime
- start time, in seconds since Unix epoch, to retrieve metric's dataendTime
- end time, in seconds since Unix epoch, to retrieve metric's dataIOException
MetricsGraphException
OutputStream createXlsReport(List<String> metricNames, String metricsDir, long startTime, long endTime, String summaryInterval) throws IOException, MetricsGraphException
metricNames
- names of the metrics to retrieve data formetricsDir
- directory containing all of the metrics' RRD files, typically
startTime
- start time, in seconds since Unix epoch, to retrieve metric's dataendTime
- end time, in seconds since Unix epoch, to retrieve metric's datasummaryInterval
- unit of time to group metrics byIOException
MetricsGraphException
OutputStream createPptReport(List<String> metricNames, String metricsDir, long startTime, long endTime) throws IOException, MetricsGraphException
metricNames
- names of the metrics to retrieve data formetricsDir
- directory containing all of the metrics' RRD files, typically
startTime
- start time, in seconds since Unix epoch, to retrieve metric's dataendTime
- end time, in seconds since Unix epoch, to retrieve metric's dataIOException
MetricsGraphException
This work is licensed under a Creative Commons Attribution 4.0 International License.