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

Method timestampComparison

test/query/TestQueryUtil.java:153–167  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

151 }
152
153 @Test
154 public void timestampComparison() {
155 long now = DateTime.currentTimeMillis() / 1000L;
156 assertFalse(QueryUtil.isTimestampAfter(now*1000, now+1));
157 assertFalse(QueryUtil.isTimestampAfter(now-1, now*1000L));
158 assertFalse(QueryUtil.isTimestampAfter(now-1, now));
159 assertFalse(QueryUtil.isTimestampAfter((now-1)*1000L, now*1000L));
160
161 assertTrue(QueryUtil.isTimestampAfter(now+1, now*1000L));
162 assertTrue(QueryUtil.isTimestampAfter(now*1000L, now-1));
163 assertTrue(QueryUtil.isTimestampAfter(now, now-1));
164 assertTrue(QueryUtil.isTimestampAfter(now*1000L, (now-1)*1000L));
165
166 assertFalse(QueryUtil.isTimestampAfter(now, now));
167 }
168}

Callers

nothing calls this directly

Calls 2

currentTimeMillisMethod · 0.95
isTimestampAfterMethod · 0.95

Tested by

no test coverage detected