Search in sources :

Example 1 with StatsDClient

use of com.timgroup.statsd.StatsDClient 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);
}
Also used : StatsDClient(com.timgroup.statsd.StatsDClient) StatsDEmitter(io.druid.emitter.statsd.StatsDEmitter) ServiceMetricEvent(com.metamx.emitter.service.ServiceMetricEvent) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) DateTime(org.joda.time.DateTime) StatsDEmitterConfig(io.druid.emitter.statsd.StatsDEmitterConfig) Test(org.junit.Test)

Example 2 with StatsDClient

use of com.timgroup.statsd.StatsDClient 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);
}
Also used : StatsDClient(com.timgroup.statsd.StatsDClient) StatsDEmitter(io.druid.emitter.statsd.StatsDEmitter) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) DateTime(org.joda.time.DateTime) StatsDEmitterConfig(io.druid.emitter.statsd.StatsDEmitterConfig) Test(org.junit.Test)

Example 3 with StatsDClient

use of com.timgroup.statsd.StatsDClient 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);
}
Also used : StatsDClient(com.timgroup.statsd.StatsDClient) StatsDEmitter(io.druid.emitter.statsd.StatsDEmitter) ServiceMetricEvent(com.metamx.emitter.service.ServiceMetricEvent) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) DateTime(org.joda.time.DateTime) StatsDEmitterConfig(io.druid.emitter.statsd.StatsDEmitterConfig) Test(org.junit.Test)

Aggregations

ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)3 StatsDClient (com.timgroup.statsd.StatsDClient)3 StatsDEmitter (io.druid.emitter.statsd.StatsDEmitter)3 StatsDEmitterConfig (io.druid.emitter.statsd.StatsDEmitterConfig)3 DateTime (org.joda.time.DateTime)3 Test (org.junit.Test)3 ServiceMetricEvent (com.metamx.emitter.service.ServiceMetricEvent)2