use of io.druid.emitter.statsd.StatsDEmitter in project druid by druid-io.
the class StatsDEmitterTest method testNoConvertRange.
@Test
public void testNoConvertRange() {
StatsDClient client = createMock(StatsDClient.class);
StatsDEmitter emitter = new StatsDEmitter(new StatsDEmitterConfig("localhost", 8888, null, null, null, null), new ObjectMapper(), client);
client.time("broker.query.time.data-source.groupBy", 10);
replay(client);
emitter.emit(new ServiceMetricEvent.Builder().setDimension("dataSource", "data-source").setDimension("type", "groupBy").setDimension("interval", "2013/2015").setDimension("some_random_dim1", "random_dim_value1").setDimension("some_random_dim2", "random_dim_value2").setDimension("hasFilters", "no").setDimension("duration", "P1D").setDimension("remoteAddress", "194.0.90.2").setDimension("id", "ID").setDimension("context", "{context}").build(new DateTime(), "query/time", 10).build("broker", "brokerHost1"));
verify(client);
}
use of io.druid.emitter.statsd.StatsDEmitter in project druid by druid-io.
the class StatsDEmitterTest method testConvertRange.
@Test
public void testConvertRange() {
StatsDClient client = createMock(StatsDClient.class);
StatsDEmitter emitter = new StatsDEmitter(new StatsDEmitterConfig("localhost", 8888, null, null, null, null), new ObjectMapper(), client);
client.gauge("broker.query.cache.total.hitRate", 54);
replay(client);
emitter.emit(new ServiceMetricEvent.Builder().setDimension("dataSource", "data-source").build(new DateTime(), "query/cache/total/hitRate", 0.54).build("broker", "brokerHost1"));
verify(client);
}
use of io.druid.emitter.statsd.StatsDEmitter in project druid by druid-io.
the class StatsDEmitterTest method testConfigOptions.
@Test
public void testConfigOptions() {
StatsDClient client = createMock(StatsDClient.class);
StatsDEmitter emitter = new StatsDEmitter(new StatsDEmitterConfig("localhost", 8888, null, "#", true, null), new ObjectMapper(), client);
client.time("brokerHost1#broker#query#time#data-source#groupBy", 10);
replay(client);
emitter.emit(new ServiceMetricEvent.Builder().setDimension("dataSource", "data-source").setDimension("type", "groupBy").setDimension("interval", "2013/2015").setDimension("some_random_dim1", "random_dim_value1").setDimension("some_random_dim2", "random_dim_value2").setDimension("hasFilters", "no").setDimension("duration", "P1D").setDimension("remoteAddress", "194.0.90.2").setDimension("id", "ID").setDimension("context", "{context}").build(new DateTime(), "query/time", 10).build("broker", "brokerHost1"));
verify(client);
}
Aggregations