MCPcopy Index your code
hub / github.com/OpenTSDB/opentsdb / getLastPointMetricResolve

Method getLastPointMetricResolve

test/meta/TestTSUIDQuery.java:462–478  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

460 }
461
462 @Test
463 public void getLastPointMetricResolve() throws Exception {
464 Whitebox.setInternalState(config, "enable_tsuid_incrementing", false);
465 Whitebox.setInternalState(config, "enable_realtime_ts", false);
466 storage.flushStorage();
467 tsdb.addPoint(METRIC_STRING, 1356998400L, 42, tags);
468
469 PowerMockito.mockStatic(DateTime.class);
470 PowerMockito.when(DateTime.currentTimeMillis()).thenReturn(1356998400000L);
471 query = new TSUIDQuery(tsdb, METRIC_STRING, tags);
472 final IncomingDataPoint dp = query.getLastPoint(true, 0).join();
473 assertEquals(1356998400000L, dp.getTimestamp());
474 assertEquals(METRIC_STRING, dp.getMetric());
475 assertSame(tags, dp.getTags());
476 assertEquals("42", dp.getValue());
477 assertEquals(UniqueId.uidToString(TSUID), dp.getTSUID());
478 }
479
480 @Test (expected = NoSuchUniqueName.class)
481 public void getLastPointMetricNSUNMetric() throws Exception {

Callers

nothing calls this directly

Calls 10

currentTimeMillisMethod · 0.95
getTimestampMethod · 0.95
getMetricMethod · 0.95
getTagsMethod · 0.95
getValueMethod · 0.95
uidToStringMethod · 0.95
getTSUIDMethod · 0.95
flushStorageMethod · 0.80
getLastPointMethod · 0.80
addPointMethod · 0.65

Tested by

no test coverage detected