use of co.cask.cdap.proto.MetricQueryResult in project cdap by caskdata.
the class MetricsHandlerTestRun method verifyEmptyQueryResult.
private void verifyEmptyQueryResult(String url) throws Exception {
MetricQueryResult queryResult = post(url, MetricQueryResult.class);
Assert.assertEquals(0, queryResult.getSeries().length);
}
use of co.cask.cdap.proto.MetricQueryResult in project cdap by caskdata.
the class MetricsHandlerTestRun method verifyRangeQueryResult.
private void verifyRangeQueryResult(String url, long nonZeroPointsCount, long expectedSum) throws Exception {
MetricQueryResult queryResult = post(url, MetricQueryResult.class);
verifyTimeSeries(queryResult.getSeries()[0], nonZeroPointsCount, expectedSum);
}
use of co.cask.cdap.proto.MetricQueryResult in project cdap by caskdata.
the class MetricsQueryHelper method decorate.
private MetricQueryResult decorate(Collection<MetricTimeSeries> series, long startTs, long endTs, int resolution) {
MetricQueryResult.TimeSeries[] serieses = new MetricQueryResult.TimeSeries[series.size()];
int i = 0;
for (MetricTimeSeries timeSeries : series) {
MetricQueryResult.TimeValue[] timeValues = decorate(timeSeries.getTimeValues());
serieses[i++] = new MetricQueryResult.TimeSeries(timeSeries.getMetricName(), tagNamesToHuman(timeSeries.getTagValues()), timeValues);
}
return new MetricQueryResult(startTs, endTs, serieses, resolution);
}
Aggregations