Package org.kairosdb.client.builder.aggregator

Examples of org.kairosdb.client.builder.aggregator.CustomAggregator.toJson()


  public void test_createCustomAggregator()
  {
    CustomAggregator aggregator = AggregatorFactory.createCustomAggregator("foobar", "\"foo\": 10");

    assertThat(aggregator.getName(), equalTo("foobar"));
    assertThat(aggregator.toJson(), equalTo("{\"name\":\"foobar\",\"foo\": 10}"));
  }

  @Test
  public void test_createDivAggregator()
  {
View Full Code Here


  public void test_createDivAggregator()
  {
    CustomAggregator aggregator = AggregatorFactory.createDivAggregator(60);

    assertThat(aggregator.getName(), equalTo("div"));
    assertThat(aggregator.toJson(), equalTo("{\"name\":\"div\",\"divisor\":60.0}"));
  }

}
View Full Code Here

  @Test
  public void test()
  {
    CustomAggregator aggregator = new CustomAggregator("testAggregator", "{\"property1\":\"value1\", \"property2\": \"value2\"}");

    assertThat(aggregator.toJson(), equalTo("{\"name\":\"testAggregator\",{\"property1\":\"value1\", \"property2\": \"value2\"}}"));
  }
}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.