MCPcopy Create free account
hub / github.com/OpenTSDB/opentsdb / gexp

Method gexp

test/tsd/TestQueryRpc.java:650–665  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

648 }
649
650 @Test
651 public void gexp() throws Exception {
652 final DataPoints[] datapoints = new DataPoints[1];
653 datapoints[0] = new MockDataPoints().getMock();
654 when(query_result.runAsync()).thenReturn(
655 Deferred.fromResult(datapoints));
656
657 final HttpQuery query = NettyMocks.getQuery(tsdb,
658 "/api/query/gexp?start=1h-ago&exp=scale(sum:sys.cpu.user,1)");
659 NettyMocks.mockChannelFuture(query);
660 rpc.execute(tsdb, query);
661 assertEquals(query.response().getStatus(), HttpResponseStatus.OK);
662 final String json =
663 query.response().getContent().toString(Charset.forName("UTF-8"));
664 assertTrue(json.contains("\"metric\":\"system.cpu.user\""));
665 }
666
667 @Test
668 public void gexpBadExpression() throws Exception {

Callers

nothing calls this directly

Calls 10

getQueryMethod · 0.95
mockChannelFutureMethod · 0.95
getMockMethod · 0.80
responseMethod · 0.80
containsMethod · 0.80
runAsyncMethod · 0.65
executeMethod · 0.65
getStatusMethod · 0.65
toStringMethod · 0.45
getContentMethod · 0.45

Tested by

no test coverage detected