MCPcopy
hub / github.com/OpenTSDB/opentsdb / oldStringPrefix

Method oldStringPrefix

test/core/TestTsdbQueryRollup.java:825–852  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

823 }
824
825 @Test
826 public void oldStringPrefix() throws Exception {
827 final RollupInterval interval = rollup_config.getRollupInterval("10m");
828 final Aggregator aggr = Aggregators.SUM;
829 long start_timestamp = 1356998400000L;
830
831 storage.addColumn("tsdb-rollup-10m".getBytes(),
832 getRowKey(METRIC_STRING, 1356998400, TAGK_STRING, TAGV_STRING),
833 "t".getBytes(),
834 new byte[] { 's', 'u', 'm', ':', 0, 0 }, new byte[] { 0x2A });
835
836 final int time_interval = interval.getIntervalSeconds();
837 setQuery(interval.getInterval(), aggr, tags, aggr);
838 query.configureFromQuery(ts_query, 0);
839
840 final DataPoints[] dps = query.run();
841 assertEquals(1, dps.length);
842 assertEquals(METRIC_STRING, dps[0].metricName());
843 assertTrue(dps[0].getAggregatedTags().isEmpty());
844 assertNull(dps[0].getAnnotations());
845 assertEquals(TAGV_STRING, dps[0].getTags().get(TAGK_STRING));
846
847 final DataPoint dp = dps[0].iterator().next();
848 assertFalse(dp.isInteger());
849 assertEquals(42, dp.doubleValue(), 0.001);
850 assertEquals(start_timestamp, dp.timestamp());
851 assertEquals(1, dps[0].size());
852 }
853
854 // ----------------- //
855 // Helper functions. //

Callers

nothing calls this directly

Calls 15

getIntervalSecondsMethod · 0.95
setQueryMethod · 0.95
getIntervalMethod · 0.95
isIntegerMethod · 0.95
doubleValueMethod · 0.95
timestampMethod · 0.95
addColumnMethod · 0.80
isEmptyMethod · 0.80
configureFromQueryMethod · 0.65
runMethod · 0.65
metricNameMethod · 0.65
getAggregatedTagsMethod · 0.65

Tested by

no test coverage detected