Polish "Allow configuration of auto-timed metrics"
This commit makes sure the "auto-time-requests" property is still available in a deprecated fashion. See gh-15988
This commit is contained in:
@@ -109,6 +109,20 @@ public class WebFluxMetricsAutoConfigurationTests {
|
||||
});
|
||||
}
|
||||
|
||||
@Test
|
||||
@Deprecated
|
||||
public void metricsAreNotRecordedIfAutoTimeRequestsIsDisabledWithDeprecatedProperty() {
|
||||
this.contextRunner
|
||||
.withConfiguration(AutoConfigurations.of(WebFluxAutoConfiguration.class))
|
||||
.withUserConfiguration(TestController.class)
|
||||
.withPropertyValues(
|
||||
"management.metrics.web.server.auto-time-requests=false")
|
||||
.run((context) -> {
|
||||
MeterRegistry registry = getInitializedMeterRegistry(context);
|
||||
assertThat(registry.find("http.server.requests").meter()).isNull();
|
||||
});
|
||||
}
|
||||
|
||||
private MeterRegistry getInitializedMeterRegistry(
|
||||
AssertableReactiveWebApplicationContext context) {
|
||||
WebTestClient webTestClient = WebTestClient.bindToApplicationContext(context)
|
||||
|
||||
Reference in New Issue
Block a user