use of io.micrometer.core.Issue in project micrometer by micrometer-metrics.
the class MeterFilterTest method renameTags.
@Test
@Issue("#329")
void renameTags() {
MeterFilter filter = MeterFilter.renameTag("hystrix", "group", "hystrixgroup");
Meter.Id id = new Meter.Id("hystrix.something", Tags.of("k", "v", "group", "mygroup"), null, null, Meter.Type.GAUGE);
assertThat(filter.map(id)).has(tag("hystrixgroup", "mygroup"));
Meter.Id id2 = new Meter.Id("something.else", Tags.of("group", "mygroup"), null, null, Meter.Type.GAUGE);
assertThat(filter.map(id2)).has(tag("group", "mygroup"));
}
use of io.micrometer.core.Issue in project micrometer by micrometer-metrics.
the class LogbackMetricsTest method removeFilterFromLoggerContextOnClose.
@Issue("#421")
@Test
void removeFilterFromLoggerContextOnClose() {
LoggerContext loggerContext = new LoggerContext();
LogbackMetrics logbackMetrics = new LogbackMetrics(emptyList(), loggerContext);
logbackMetrics.bindTo(registry);
assertThat(loggerContext.getTurboFilterList()).hasSize(1);
logbackMetrics.close();
assertThat(loggerContext.getTurboFilterList()).isEmpty();
}
use of io.micrometer.core.Issue in project micrometer by micrometer-metrics.
the class StatsdMeterRegistryTest method counterIncrementDoesNotCauseStackOverflow.
@Issue("#411")
@Test
void counterIncrementDoesNotCauseStackOverflow() {
StatsdMeterRegistry registry = new StatsdMeterRegistry(configWithFlavor(StatsdFlavor.ETSY), clock);
new LogbackMetrics().bindTo(registry);
// Cause the publisher to get into a state that would make it perform logging at DEBUG level.
((Logger) LoggerFactory.getLogger(Operators.class)).setLevel(Level.DEBUG);
registry.publisher.onComplete();
registry.counter("my.counter").increment();
}
use of io.micrometer.core.Issue in project micrometer by micrometer-metrics.
the class ElasticMeterRegistryTest method wholeCountIsReportedWithDecimal.
@Issue("#498")
@Test
void wholeCountIsReportedWithDecimal() {
Counter c = Counter.builder("counter").register(registry);
c.increment(10);
assertThat(registry.writeCounter(c, 0)).containsExactly("{\"index\":{\"_index\":\"metrics-1970-01\",\"_type\":\"doc\"}}\n" + "{\"@timestamp\":\"1970-01-01T00:00:00Z\",\"name\":\"counter\",\"type\":\"counter\",\"count\":0.0}");
}
use of io.micrometer.core.Issue in project micrometer by micrometer-metrics.
the class AtlasMeterRegistryTest method publishOneLastTimeOnClose.
@Issue("#484")
@Test
void publishOneLastTimeOnClose() throws InterruptedException {
URI uri = URI.create(config.uri());
CountDownLatch latch = new CountDownLatch(1);
BlockingNettyContext blockingFacade = HttpServer.create(uri.getHost(), uri.getPort()).start((req, resp) -> {
latch.countDown();
return resp.send();
});
try {
registry.close();
latch.await(10, TimeUnit.SECONDS);
assertThat(latch.getCount()).isZero();
} finally {
blockingFacade.shutdown();
}
}
Aggregations