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

Method nsunMetric

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

Source from the content-addressed store, hash-verified

550 }
551
552 @Test
553 public void nsunMetric() throws Exception {
554 oneExtraSameE();
555 final Metric metric1 = Metric.Builder().setMetric("A").setId("a")
556 .setFilter("f1").setAggregator("sum").build();
557 final Metric metric2 = Metric.Builder().setMetric(NSUN_METRIC).setId("b")
558 .setFilter("f1").setAggregator("sum").build();
559 metrics = Arrays.asList(metric1, metric2);
560 final String json = JSON.serializeToString(getDefaultQueryBuilder().build());
561
562 final QueryRpc rpc = new QueryRpc();
563 final HttpQuery query = NettyMocks.postQuery(tsdb,
564 "/api/query/exp", json);
565 query.getQueryBaseRoute(); // to the correct serializer
566 NettyMocks.mockChannelFuture(query);
567
568 rpc.execute(tsdb, query);
569 final String response =
570 query.response().getContent().toString(Charset.forName("UTF-8"));
571 assertTrue(response.contains("\"code\":400"));
572 assertTrue(response.contains("\"message\":\"No such name for '" +
573 NSUN_METRIC + "'"));
574 }
575
576 @Test
577 public void selfReferencingExpression() throws Exception {

Callers

nothing calls this directly

Calls 15

BuilderMethod · 0.95
serializeToStringMethod · 0.95
postQueryMethod · 0.95
getQueryBaseRouteMethod · 0.95
mockChannelFutureMethod · 0.95
executeMethod · 0.95
oneExtraSameEMethod · 0.80
responseMethod · 0.80
containsMethod · 0.80
buildMethod · 0.45
setAggregatorMethod · 0.45

Tested by

no test coverage detected