@Test
public void testIfQueryHasHistogram() {

    long startTime = System.currentTimeMillis()-60*60*1000, endTime = System.currentTimeMillis();
    MetricQuery query = new MetricQuery("scope", "metric", new HashMap<>(),
            startTime, endTime);
    assertFalse(cachedTSDBService.isQueryHavingHistogram(query));
    query = new MetricQuery("scope", "metric", new HashMap<>(),startTime, endTime);
    query.setShowHistogramBuckets(true);
    assertTrue(cachedTSDBService.isQueryHavingHistogram(query));
    query = new MetricQuery("scope", "metric", new HashMap<>(),startTime, endTime);
    query.setPercentile(new String[]{"50"});
    assertTrue(cachedTSDBService.isQueryHavingHistogram(query));
}