Google's Chart Tools Datasource protocol can present metrics data.
The Google Visualization API query language (the tq request parameter) is not supported. The PingDataMetrics Server supports JSON, HTML, CSV, and TSV data formats as outlined by the Datasource protocol.
URL |
|
Method |
GET |
Formats |
JSON, HTML, CSV, and TSV |
Query Parameters |
|
All Common query parameters apply to this resource.
curl \
-X GET \
https://<metricsServerHost>:8080/api/v1/metrics/response-time/datatable?
tqx=out:csv&maxIntervals=10
&pivot=op-type&pivot=instance&tz=US/Central
Response Code |
200 0K |
Response Body |
When only one time interval is requested, the first pivoted dimension values form the first column. For queries that request more than one time interval, the start of each time interval forms the first column. Combinations of subsequent pivoted dimension values and/or histogram buckets are included as additional columns. All date and time values are under the GMT time zone.
|
<html>
<head>
<!--Load the AJAX API-->
<script type="text/javascript"
src="https://www.google.com/jsapi"></script>
<script type="text/javascript">
// Load the Visualization API and the line chart package.
google.load('visualization', '1.0', {'packages':['corechart']});
// Set a callback to run when the Google Visualization API is loaded.
google.setOnLoadCallback(drawChart);
function drawChart() {
var query = new google.visualization.Query
('https://<MetricsHost>:8080/
api/v1/metrics/response-time/datatable?maxIntervals=10
&pivot=optype&pivot=instance');
query.send(handleQueryResponse);
}
function handleQueryResponse(response) {
if (response.isError()) {
alert('Error in query: ' + response.getMessage() + ' '
+ response.getDetailedMessage());
return;
}
var data = response.getDataTable();
var visualization = new
google.visualization.LineChart(document.getElementById('chart_div'));
visualization.draw(data, null);
}
</script>
</head>
<body>
<!--Div that will hold the chart-->
<div id="chart_div"></div>
</body>
</html>