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

Method runRegexp

test/core/TestTsdbQueryQueries.java:1521–1544  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1519 }
1520
1521 @Test
1522 public void runRegexp() throws Exception {
1523 storeLongTimeSeriesSeconds(true, false);
1524
1525 query.setStartTime(1356998400);
1526 query.setEndTime(1357041600);
1527 tags.clear();
1528 tags.put("host", "regexp(web01)");
1529 query.setTimeSeries(METRIC_STRING, tags, Aggregators.SUM, false);
1530
1531 final DataPoints[] dps = query.run();
1532 assertMeta(dps, 0, false);
1533 verify(tag_values, atLeast(1)).getNameAsync(TAGV_BYTES);
1534 verify(tag_values, atLeast(1)).getNameAsync(TAGV_B_BYTES);
1535 int value = 1;
1536 long timestamp = 1356998430000L;
1537 for (DataPoint dp : dps[0]) {
1538 assertEquals(value, dp.longValue());
1539 assertEquals(timestamp, dp.timestamp());
1540 value++;
1541 timestamp += 30000;
1542 }
1543 assertEquals(300, dps[0].aggregatedSize());
1544 }
1545
1546 @Test
1547 public void runRegexpNoMatch() throws Exception {

Callers

nothing calls this directly

Calls 12

clearMethod · 0.80
putMethod · 0.80
assertMetaMethod · 0.80
getNameAsyncMethod · 0.80
setStartTimeMethod · 0.65
setEndTimeMethod · 0.65
setTimeSeriesMethod · 0.65
runMethod · 0.65
longValueMethod · 0.65
timestampMethod · 0.65
aggregatedSizeMethod · 0.65

Tested by

no test coverage detected