Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DEMO
spring-boot
Commits
1f1b06df
Commit
1f1b06df
authored
Jan 14, 2020
by
Scott Frederick
Committed by
Stephane Nicoll
Jan 16, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove deprecated Actuator metrics 2.2 code
See gh-19699
parent
03139f06
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
5 additions
and
174 deletions
+5
-174
MetricsProperties.java
...boot/actuate/autoconfigure/metrics/MetricsProperties.java
+0
-67
WebFluxMetricsAutoConfigurationTests.java
...cs/web/reactive/WebFluxMetricsAutoConfigurationTests.java
+0
-11
MetricsClientHttpRequestInterceptor.java
...trics/web/client/MetricsClientHttpRequestInterceptor.java
+0
-14
MetricsRestTemplateCustomizer.java
...ate/metrics/web/client/MetricsRestTemplateCustomizer.java
+1
-17
MetricsWebClientCustomizer.java
...trics/web/reactive/client/MetricsWebClientCustomizer.java
+1
-17
MetricsWebClientFilterFunction.java
...s/web/reactive/client/MetricsWebClientFilterFunction.java
+1
-15
MetricsWebFilter.java
...actuate/metrics/web/reactive/server/MetricsWebFilter.java
+1
-16
WebMvcMetricsFilter.java
...boot/actuate/metrics/web/servlet/WebMvcMetricsFilter.java
+1
-17
No files found.
spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/MetricsProperties.java
View file @
1f1b06df
...
@@ -20,7 +20,6 @@ import java.util.LinkedHashMap;
...
@@ -20,7 +20,6 @@ import java.util.LinkedHashMap;
import
java.util.Map
;
import
java.util.Map
;
import
org.springframework.boot.context.properties.ConfigurationProperties
;
import
org.springframework.boot.context.properties.ConfigurationProperties
;
import
org.springframework.boot.context.properties.DeprecatedConfigurationProperty
;
import
org.springframework.boot.context.properties.NestedConfigurationProperty
;
import
org.springframework.boot.context.properties.NestedConfigurationProperty
;
/**
/**
...
@@ -110,28 +109,6 @@ public class MetricsProperties {
...
@@ -110,28 +109,6 @@ public class MetricsProperties {
return
this
.
request
;
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
()
{
public
int
getMaxUriTags
()
{
return
this
.
maxUriTags
;
return
this
.
maxUriTags
;
}
}
...
@@ -184,50 +161,6 @@ public class MetricsProperties {
...
@@ -184,50 +161,6 @@ public class MetricsProperties {
return
this
.
request
;
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
()
{
public
int
getMaxUriTags
()
{
return
this
.
maxUriTags
;
return
this
.
maxUriTags
;
}
}
...
...
spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/web/reactive/WebFluxMetricsAutoConfigurationTests.java
View file @
1f1b06df
...
@@ -112,17 +112,6 @@ class WebFluxMetricsAutoConfigurationTests {
...
@@ -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
)
{
private
MeterRegistry
getInitializedMeterRegistry
(
AssertableReactiveWebApplicationContext
context
)
{
WebTestClient
webTestClient
=
WebTestClient
.
bindToApplicationContext
(
context
).
build
();
WebTestClient
webTestClient
=
WebTestClient
.
bindToApplicationContext
(
context
).
build
();
for
(
int
i
=
0
;
i
<
3
;
i
++)
{
for
(
int
i
=
0
;
i
<
3
;
i
++)
{
...
...
spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/client/MetricsClientHttpRequestInterceptor.java
View file @
1f1b06df
...
@@ -53,20 +53,6 @@ class MetricsClientHttpRequestInterceptor implements ClientHttpRequestIntercepto
...
@@ -53,20 +53,6 @@ class MetricsClientHttpRequestInterceptor implements ClientHttpRequestIntercepto
private
final
AutoTimer
autoTimer
;
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}.
* Create a new {@code MetricsClientHttpRequestInterceptor}.
* @param meterRegistry the registry to which metrics are recorded
* @param meterRegistry the registry to which metrics are recorded
...
...
spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/client/MetricsRestTemplateCustomizer.java
View file @
1f1b06df
/*
/*
* Copyright 2012-20
19
the original author or authors.
* Copyright 2012-20
20
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -39,22 +39,6 @@ public class MetricsRestTemplateCustomizer implements RestTemplateCustomizer {
...
@@ -39,22 +39,6 @@ public class MetricsRestTemplateCustomizer implements RestTemplateCustomizer {
private
final
MetricsClientHttpRequestInterceptor
interceptor
;
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}
* Creates a new {@code MetricsRestTemplateInterceptor}. When {@code autoTimeRequests}
* is set to {@code true}, the interceptor records metrics using the given
* is set to {@code true}, the interceptor records metrics using the given
...
...
spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/reactive/client/MetricsWebClientCustomizer.java
View file @
1f1b06df
/*
/*
* Copyright 2012-20
19
the original author or authors.
* Copyright 2012-20
20
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -33,22 +33,6 @@ public class MetricsWebClientCustomizer implements WebClientCustomizer {
...
@@ -33,22 +33,6 @@ public class MetricsWebClientCustomizer implements WebClientCustomizer {
private
final
MetricsWebClientFilterFunction
filterFunction
;
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
* Create a new {@code MetricsWebClientFilterFunction} that will record metrics using
* the given {@code meterRegistry} with tags provided by the given
* the given {@code meterRegistry} with tags provided by the given
...
...
spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/reactive/client/MetricsWebClientFilterFunction.java
View file @
1f1b06df
/*
/*
* Copyright 2012-20
19
the original author or authors.
* Copyright 2012-20
20
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -50,20 +50,6 @@ public class MetricsWebClientFilterFunction implements ExchangeFilterFunction {
...
@@ -50,20 +50,6 @@ public class MetricsWebClientFilterFunction implements ExchangeFilterFunction {
private
final
AutoTimer
autoTimer
;
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}.
* Create a new {@code MetricsWebClientFilterFunction}.
* @param meterRegistry the registry to which metrics are recorded
* @param meterRegistry the registry to which metrics are recorded
...
...
spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/reactive/server/MetricsWebFilter.java
View file @
1f1b06df
/*
/*
* Copyright 2012-20
19
the original author or authors.
* Copyright 2012-20
20
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -49,21 +49,6 @@ public class MetricsWebFilter implements WebFilter {
...
@@ -49,21 +49,6 @@ public class MetricsWebFilter implements WebFilter {
private
final
AutoTimer
autoTimer
;
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}.
* Create a new {@code MetricsWebFilter}.
* @param registry the registry to which metrics are recorded
* @param registry the registry to which metrics are recorded
...
...
spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/servlet/WebMvcMetricsFilter.java
View file @
1f1b06df
/*
/*
* Copyright 2012-20
19
the original author or authors.
* Copyright 2012-20
20
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -60,22 +60,6 @@ public class WebMvcMetricsFilter extends OncePerRequestFilter {
...
@@ -60,22 +60,6 @@ public class WebMvcMetricsFilter extends OncePerRequestFilter {
private
final
AutoTimer
autoTimer
;
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.
* Create a new {@link WebMvcMetricsFilter} instance.
* @param registry the meter registry
* @param registry the meter registry
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment