Commit 1f1b06df authored by Scott Frederick's avatar Scott Frederick Committed by Stephane Nicoll

Remove deprecated Actuator metrics 2.2 code

See gh-19699
parent 03139f06
......@@ -20,7 +20,6 @@ import java.util.LinkedHashMap;
import java.util.Map;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.DeprecatedConfigurationProperty;
import org.springframework.boot.context.properties.NestedConfigurationProperty;
/**
......@@ -110,28 +109,6 @@ public class MetricsProperties {
return this.request;
}
/**
* Return the name of the metric for client requests.
* @return request metric name
* @deprecated since 2.2.0 in favor of {@link ClientRequest#getMetricName()}
*/
@Deprecated
@DeprecatedConfigurationProperty(replacement = "management.metrics.web.client.request.metric-name")
public String getRequestsMetricName() {
return this.request.getMetricName();
}
/**
* Set the name of the metric for client requests.
* @param requestsMetricName request metric name
* @deprecated since 2.2.0 in favor of
* {@link ClientRequest#setMetricName(String)}
*/
@Deprecated
public void setRequestsMetricName(String requestsMetricName) {
this.request.setMetricName(requestsMetricName);
}
public int getMaxUriTags() {
return this.maxUriTags;
}
......@@ -184,50 +161,6 @@ public class MetricsProperties {
return this.request;
}
/**
* Return whether server requests should be automatically timed.
* @return {@code true} if server request should be automatically timed
* @deprecated since 2.2.0 in favor of {@link AutoTimeProperties#isEnabled()}
*/
@DeprecatedConfigurationProperty(replacement = "management.metrics.web.server.request.autotime.enabled")
@Deprecated
public boolean isAutoTimeRequests() {
return this.request.getAutotime().isEnabled();
}
/**
* Set whether server requests should be automatically timed.
* @param autoTimeRequests whether server requests should be automatically
* timed
* @deprecated since 2.2.0 in favor of {@link AutoTimeProperties#isEnabled()}
*/
@Deprecated
public void setAutoTimeRequests(boolean autoTimeRequests) {
this.request.getAutotime().setEnabled(autoTimeRequests);
}
/**
* Return name of the metric for server requests.
* @return request metric name
* @deprecated since 2.2.0 in favor of {@link ServerRequest#getMetricName()}
*/
@DeprecatedConfigurationProperty(replacement = "management.metrics.web.server.request.metric-name")
@Deprecated
public String getRequestsMetricName() {
return this.request.getMetricName();
}
/**
* Set the name of the metric for server requests.
* @param requestsMetricName request metric name
* @deprecated since 2.2.0 in favor of
* {@link ServerRequest#setMetricName(String)}
*/
@Deprecated
public void setRequestsMetricName(String requestsMetricName) {
this.request.setMetricName(requestsMetricName);
}
public int getMaxUriTags() {
return this.maxUriTags;
}
......
......@@ -112,17 +112,6 @@ class WebFluxMetricsAutoConfigurationTests {
});
}
@Test
@Deprecated
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).build();
for (int i = 0; i < 3; i++) {
......
......@@ -53,20 +53,6 @@ class MetricsClientHttpRequestInterceptor implements ClientHttpRequestIntercepto
private final AutoTimer autoTimer;
/**
* Create a new {@code MetricsClientHttpRequestInterceptor}.
* @param meterRegistry the registry to which metrics are recorded
* @param tagProvider provider for metrics tags
* @param metricName name of the metric to record
* @deprecated since 2.2.0 in favor of
* {@link #MetricsClientHttpRequestInterceptor(MeterRegistry, RestTemplateExchangeTagsProvider, String, AutoTimer)}
*/
@Deprecated
MetricsClientHttpRequestInterceptor(MeterRegistry meterRegistry, RestTemplateExchangeTagsProvider tagProvider,
String metricName) {
this(meterRegistry, tagProvider, metricName, AutoTimer.ENABLED);
}
/**
* Create a new {@code MetricsClientHttpRequestInterceptor}.
* @param meterRegistry the registry to which metrics are recorded
......
/*
* Copyright 2012-2019 the original author or authors.
* Copyright 2012-2020 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......@@ -39,22 +39,6 @@ public class MetricsRestTemplateCustomizer implements RestTemplateCustomizer {
private final MetricsClientHttpRequestInterceptor interceptor;
/**
* Creates a new {@code MetricsRestTemplateInterceptor} that will record metrics using
* the given {@code meterRegistry} with tags provided by the given
* {@code tagProvider}.
* @param meterRegistry the meter registry
* @param tagProvider the tag provider
* @param metricName the name of the recorded metric
* @deprecated since 2.2.0 in favor of
* {@link #MetricsRestTemplateCustomizer(MeterRegistry, RestTemplateExchangeTagsProvider, String, AutoTimer)}
*/
@Deprecated
public MetricsRestTemplateCustomizer(MeterRegistry meterRegistry, RestTemplateExchangeTagsProvider tagProvider,
String metricName) {
this(meterRegistry, tagProvider, metricName, AutoTimer.ENABLED);
}
/**
* Creates a new {@code MetricsRestTemplateInterceptor}. When {@code autoTimeRequests}
* is set to {@code true}, the interceptor records metrics using the given
......
/*
* Copyright 2012-2019 the original author or authors.
* Copyright 2012-2020 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......@@ -33,22 +33,6 @@ public class MetricsWebClientCustomizer implements WebClientCustomizer {
private final MetricsWebClientFilterFunction filterFunction;
/**
* Create a new {@code MetricsWebClientFilterFunction} that will record metrics using
* the given {@code meterRegistry} with tags provided by the given
* {@code tagProvider}.
* @param meterRegistry the meter registry
* @param tagProvider the tag provider
* @param metricName the name of the recorded metric
* @deprecated since 2.2.0 in favor of
* {@link #MetricsWebClientCustomizer(MeterRegistry, WebClientExchangeTagsProvider, String, AutoTimer)}
*/
@Deprecated
public MetricsWebClientCustomizer(MeterRegistry meterRegistry, WebClientExchangeTagsProvider tagProvider,
String metricName) {
this(meterRegistry, tagProvider, metricName, AutoTimer.ENABLED);
}
/**
* Create a new {@code MetricsWebClientFilterFunction} that will record metrics using
* the given {@code meterRegistry} with tags provided by the given
......
/*
* Copyright 2012-2019 the original author or authors.
* Copyright 2012-2020 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......@@ -50,20 +50,6 @@ public class MetricsWebClientFilterFunction implements ExchangeFilterFunction {
private final AutoTimer autoTimer;
/**
* Create a new {@code MetricsWebClientFilterFunction}.
* @param meterRegistry the registry to which metrics are recorded
* @param tagProvider provider for metrics tags
* @param metricName name of the metric to record
* @deprecated since 2.2.0 in favor of
* {@link #MetricsWebClientFilterFunction(MeterRegistry, WebClientExchangeTagsProvider, String, AutoTimer)}
*/
@Deprecated
public MetricsWebClientFilterFunction(MeterRegistry meterRegistry, WebClientExchangeTagsProvider tagProvider,
String metricName) {
this(meterRegistry, tagProvider, metricName, AutoTimer.ENABLED);
}
/**
* Create a new {@code MetricsWebClientFilterFunction}.
* @param meterRegistry the registry to which metrics are recorded
......
/*
* Copyright 2012-2019 the original author or authors.
* Copyright 2012-2020 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......@@ -49,21 +49,6 @@ public class MetricsWebFilter implements WebFilter {
private final AutoTimer autoTimer;
/**
* Create a new {@code MetricsWebFilter}.
* @param registry the registry to which metrics are recorded
* @param tagsProvider provider for metrics tags
* @param metricName name of the metric to record
* @param autoTimeRequests if requests should be automatically timed
* @deprecated since 2.2.0 in favor of
* {@link #MetricsWebFilter(MeterRegistry, WebFluxTagsProvider, String, AutoTimer)}
*/
@Deprecated
public MetricsWebFilter(MeterRegistry registry, WebFluxTagsProvider tagsProvider, String metricName,
boolean autoTimeRequests) {
this(registry, tagsProvider, metricName, AutoTimer.ENABLED);
}
/**
* Create a new {@code MetricsWebFilter}.
* @param registry the registry to which metrics are recorded
......
/*
* Copyright 2012-2019 the original author or authors.
* Copyright 2012-2020 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......@@ -60,22 +60,6 @@ public class WebMvcMetricsFilter extends OncePerRequestFilter {
private final AutoTimer autoTimer;
/**
* Create a new {@link WebMvcMetricsFilter} instance.
* @param registry the meter registry
* @param tagsProvider the tags provider
* @param metricName the metric name
* @param autoTimeRequests if requests should be automatically timed
* @since 2.0.7
* @deprecated since 2.2.0 in favor of
* {@link #WebMvcMetricsFilter(MeterRegistry, WebMvcTagsProvider, String, AutoTimer)}
*/
@Deprecated
public WebMvcMetricsFilter(MeterRegistry registry, WebMvcTagsProvider tagsProvider, String metricName,
boolean autoTimeRequests) {
this(registry, tagsProvider, metricName, AutoTimer.ENABLED);
}
/**
* Create a new {@link WebMvcMetricsFilter} instance.
* @param registry the meter registry
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment