コード例 #1
0
 private int getNumberOfPointsViaHTTPHandler(
     HttpRollupsQueryHandler handler, Locator locator, long from, long to, Resolution resolution)
     throws Exception {
   final MetricData values =
       handler.GetDataByResolution(
           locator.getTenantId(), locator.getMetricName(), from, to, resolution);
   return values.getData().getPoints().size();
 }
コード例 #2
0
 private void testHTTPRollupHandlerGetByPoints(
     Map<Locator, Map<Granularity, Integer>> answers,
     Map<Granularity, Integer> points,
     long from,
     long to)
     throws Exception {
   for (Locator locator : locators) {
     for (Granularity g2 : Granularity.granularities()) {
       MetricData data =
           httpHandler.GetDataByPoints(
               locator.getTenantId(),
               locator.getMetricName(),
               baseMillis,
               baseMillis + 86400000,
               points.get(g2));
       Assert.assertEquals((int) answers.get(locator).get(g2), data.getData().getPoints().size());
       Assert.assertEquals(locatorToUnitMap.get(locator), data.getUnit());
     }
   }
 }