use of io.micrometer.graphite.GraphiteMeterRegistry in project spring-boot by spring-projects.
the class GraphiteMetricsExportAutoConfigurationTests method autoConfiguresWithTagsAsPrefixCanBeDisabled.
@Test
void autoConfiguresWithTagsAsPrefixCanBeDisabled() {
this.contextRunner.withUserConfiguration(BaseConfiguration.class).withPropertyValues("management.metrics.export.graphite.tags-as-prefix=app", "management.metrics.export.graphite.graphite-tags-enabled=true").run((context) -> {
assertThat(context).hasSingleBean(GraphiteMeterRegistry.class);
GraphiteMeterRegistry registry = context.getBean(GraphiteMeterRegistry.class);
registry.counter("test.count", Tags.of("app", "myapp"));
assertThat(registry.getDropwizardRegistry().getMeters()).containsOnlyKeys("test.count;app=myapp");
});
}
use of io.micrometer.graphite.GraphiteMeterRegistry in project spring-boot by spring-projects.
the class GraphiteMetricsExportAutoConfigurationTests method autoConfiguresUseTagsAsPrefix.
@Test
void autoConfiguresUseTagsAsPrefix() {
this.contextRunner.withUserConfiguration(BaseConfiguration.class).withPropertyValues("management.metrics.export.graphite.tags-as-prefix=app").run((context) -> {
assertThat(context).hasSingleBean(GraphiteMeterRegistry.class);
GraphiteMeterRegistry registry = context.getBean(GraphiteMeterRegistry.class);
registry.counter("test.count", Tags.of("app", "myapp"));
assertThat(registry.getDropwizardRegistry().getMeters()).containsOnlyKeys("myapp.testCount");
});
}
use of io.micrometer.graphite.GraphiteMeterRegistry in project spring-boot by spring-projects.
the class GraphiteMetricsExportAutoConfigurationTests method stopsMeterRegistryWhenContextIsClosed.
@Test
void stopsMeterRegistryWhenContextIsClosed() {
this.contextRunner.withUserConfiguration(BaseConfiguration.class).run((context) -> {
GraphiteMeterRegistry registry = context.getBean(GraphiteMeterRegistry.class);
assertThat(registry.isClosed()).isFalse();
context.close();
assertThat(registry.isClosed()).isTrue();
});
}
Aggregations