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

Method oneExpressionNoFilter

test/tsd/TestQueryExecutor.java:260–287  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

258// }
259
260 @Test
261 public void oneExpressionNoFilter() throws Exception {
262 oneExtraSameE();
263 final Metric metric1 = Metric.Builder().setMetric("A").setId("a")
264 .build();
265 final Metric metric2 = Metric.Builder().setMetric("B").setId("b")
266 .build();
267 metrics = Arrays.asList(metric1, metric2);
268
269 final String json = JSON.serializeToString(getDefaultQueryBuilder().build());
270 final QueryRpc rpc = new QueryRpc();
271 final HttpQuery query = NettyMocks.postQuery(tsdb,
272 "/api/query/exp", json);
273 NettyMocks.mockChannelFuture(query);
274
275 rpc.execute(tsdb, query);
276 final String response =
277 query.response().getContent().toString(Charset.forName("UTF-8"));
278System.out.println(response);
279 assertTrue(response.contains("\"alias\":\"A plus B\""));
280 assertTrue(response.contains("\"dps\":[[1431561600000,47.0]"));
281 assertTrue(response.contains("[1431561660000,52.0]"));
282 assertTrue(response.contains("[1431561720000,57.0]"));
283 assertTrue(response.contains("\"firstTimestamp\":1431561600000"));
284 assertTrue(response.contains("\"index\":1"));
285 assertTrue(response.contains("\"metrics\":[\"A\",\"B\"]"));
286 assertTrue(response.contains("\"index\":1"));
287 }
288
289 @Test
290 public void twoExpressionsDefaultOutput() throws Exception {

Callers

nothing calls this directly

Calls 14

BuilderMethod · 0.95
serializeToStringMethod · 0.95
postQueryMethod · 0.95
mockChannelFutureMethod · 0.95
executeMethod · 0.95
oneExtraSameEMethod · 0.80
responseMethod · 0.80
containsMethod · 0.80
buildMethod · 0.45
setIdMethod · 0.45
setMetricMethod · 0.45

Tested by

no test coverage detected