Search in sources :

Example 1 with LogbackMetrics

use of io.micrometer.core.instrument.binder.logging.LogbackMetrics 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();
}
Also used : Operators(reactor.core.publisher.Operators) Logger(ch.qos.logback.classic.Logger) LogbackMetrics(io.micrometer.core.instrument.binder.logging.LogbackMetrics) Issue(io.micrometer.core.Issue) Test(org.junit.jupiter.api.Test) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest)

Aggregations

Logger (ch.qos.logback.classic.Logger)1 Issue (io.micrometer.core.Issue)1 LogbackMetrics (io.micrometer.core.instrument.binder.logging.LogbackMetrics)1 Test (org.junit.jupiter.api.Test)1 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)1 Operators (reactor.core.publisher.Operators)1