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

Method evaluateWithATag

test/query/expression/TestAlias.java:231–250  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

229 }
230
231 @Test
232 public void evaluateWithATag() throws Exception {
233 SeekableView view2 = SeekableViewsForTest.generator(START_TIME, INTERVAL,
234 NUM_POINTS, true, 10, 1);
235 DataPoints dps2 = PowerMockito.mock(DataPoints.class);
236 when(dps2.iterator()).thenReturn(view2);
237 when(dps2.metricName()).thenReturn("sys.mem");
238 when(dps2.getTagsAsync()).thenReturn(Deferred.fromResult(tags));
239 when(dps2.getTagUids()).thenReturn(tag_uids);
240 group_bys = new DataPoints[] { dps, dps2 };
241 query_results.clear();
242 query_results.add(group_bys);
243 params.add("My Alias.@dc");
244
245 final DataPoints[] results = func.evaluate(data_query, query_results, params);
246
247 assertEquals(2, results.length);
248 assertEquals("My Alias.lga", results[0].metricName());
249 assertEquals("My Alias.lga", results[1].metricName());
250 }
251
252 @Test
253 public void evaluateWithTagsJoined() throws Exception {

Callers

nothing calls this directly

Calls 8

generatorMethod · 0.95
iteratorMethod · 0.95
metricNameMethod · 0.95
getTagsAsyncMethod · 0.95
getTagUidsMethod · 0.95
clearMethod · 0.80
evaluateMethod · 0.65
addMethod · 0.45

Tested by

no test coverage detected