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
182b75a1
Commit
182b75a1
authored
Apr 15, 2021
by
Stephane Nicoll
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #26135 from izeye
* pr/26135: Polish Closes gh-26135
parents
641df02b
e27c8569
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
16 additions
and
21 deletions
+16
-21
build.gradle
...t-project/spring-boot-actuator-autoconfigure/build.gradle
+1
-1
MongoMetricsAutoConfiguration.java
...onfigure/metrics/mongo/MongoMetricsAutoConfiguration.java
+1
-1
RepositoryMetricsAutoConfigurationIntegrationTests.java
...a/RepositoryMetricsAutoConfigurationIntegrationTests.java
+1
-1
RepositoryMetricsAutoConfigurationTests.java
...metrics/data/RepositoryMetricsAutoConfigurationTests.java
+5
-9
build.gradle
spring-boot-project/spring-boot-actuator/build.gradle
+1
-1
TimedAnnotations.java
...ork/boot/actuate/metrics/annotation/TimedAnnotations.java
+2
-2
ServerProperties.java
...ingframework/boot/autoconfigure/web/ServerProperties.java
+1
-1
ServerPropertiesTests.java
...amework/boot/autoconfigure/web/ServerPropertiesTests.java
+0
-1
production-ready-features.adoc
...oot-docs/src/docs/asciidoc/production-ready-features.adoc
+1
-1
spring-boot-features.adoc
...ing-boot-docs/src/docs/asciidoc/spring-boot-features.adoc
+1
-1
CloudPlatformTests.java
...va/org/springframework/boot/cloud/CloudPlatformTests.java
+2
-2
No files found.
spring-boot-project/spring-boot-actuator-autoconfigure/build.gradle
View file @
182b75a1
...
@@ -86,7 +86,7 @@ dependencies {
...
@@ -86,7 +86,7 @@ dependencies {
optional
(
"org.mongodb:mongodb-driver-reactivestreams"
)
optional
(
"org.mongodb:mongodb-driver-reactivestreams"
)
optional
(
"org.mongodb:mongodb-driver-sync"
)
optional
(
"org.mongodb:mongodb-driver-sync"
)
optional
(
"org.neo4j.driver:neo4j-java-driver"
)
optional
(
"org.neo4j.driver:neo4j-java-driver"
)
optional
(
"org.quartz-scheduler:quartz"
)
optional
(
"org.quartz-scheduler:quartz"
)
optional
(
"org.springframework:spring-jdbc"
)
optional
(
"org.springframework:spring-jdbc"
)
optional
(
"org.springframework:spring-jms"
)
optional
(
"org.springframework:spring-jms"
)
optional
(
"org.springframework:spring-messaging"
)
optional
(
"org.springframework:spring-messaging"
)
...
...
spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/mongo/MongoMetricsAutoConfiguration.java
View file @
182b75a1
...
@@ -93,7 +93,7 @@ public class MongoMetricsAutoConfiguration {
...
@@ -93,7 +93,7 @@ public class MongoMetricsAutoConfiguration {
@Bean
@Bean
@ConditionalOnMissingBean
@ConditionalOnMissingBean
MongoConnectionPoolTagsProvider
mongo
Metrics
ConnectionPoolTagsProvider
()
{
MongoConnectionPoolTagsProvider
mongoConnectionPoolTagsProvider
()
{
return
new
DefaultMongoConnectionPoolTagsProvider
();
return
new
DefaultMongoConnectionPoolTagsProvider
();
}
}
...
...
spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/data/RepositoryMetricsAutoConfigurationIntegrationTests.java
View file @
182b75a1
...
@@ -37,7 +37,7 @@ import static org.assertj.core.api.Assertions.assertThat;
...
@@ -37,7 +37,7 @@ import static org.assertj.core.api.Assertions.assertThat;
*
*
* @author Phillip Webb
* @author Phillip Webb
*/
*/
public
class
RepositoryMetricsAutoConfigurationIntegrationTests
{
class
RepositoryMetricsAutoConfigurationIntegrationTests
{
private
final
ApplicationContextRunner
contextRunner
=
new
ApplicationContextRunner
().
with
(
MetricsRun
.
simple
())
private
final
ApplicationContextRunner
contextRunner
=
new
ApplicationContextRunner
().
with
(
MetricsRun
.
simple
())
.
withConfiguration
(
.
withConfiguration
(
...
...
spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/data/RepositoryMetricsAutoConfigurationTests.java
View file @
182b75a1
...
@@ -28,7 +28,6 @@ import io.micrometer.core.instrument.distribution.HistogramSnapshot;
...
@@ -28,7 +28,6 @@ import io.micrometer.core.instrument.distribution.HistogramSnapshot;
import
org.junit.jupiter.api.Test
;
import
org.junit.jupiter.api.Test
;
import
org.springframework.boot.actuate.autoconfigure.metrics.test.MetricsRun
;
import
org.springframework.boot.actuate.autoconfigure.metrics.test.MetricsRun
;
import
org.springframework.boot.actuate.autoconfigure.metrics.web.TestController
;
import
org.springframework.boot.actuate.metrics.AutoTimer
;
import
org.springframework.boot.actuate.metrics.AutoTimer
;
import
org.springframework.boot.actuate.metrics.data.DefaultRepositoryTagsProvider
;
import
org.springframework.boot.actuate.metrics.data.DefaultRepositoryTagsProvider
;
import
org.springframework.boot.actuate.metrics.data.MetricsRepositoryMethodInvocationListener
;
import
org.springframework.boot.actuate.metrics.data.MetricsRepositoryMethodInvocationListener
;
...
@@ -93,8 +92,8 @@ class RepositoryMetricsAutoConfigurationTests {
...
@@ -93,8 +92,8 @@ class RepositoryMetricsAutoConfigurationTests {
@Test
@Test
void
metricNameCanBeConfigured
()
{
void
metricNameCanBeConfigured
()
{
this
.
contextRunner
.
with
UserConfiguration
(
TestController
.
class
)
this
.
contextRunner
.
with
PropertyValues
(
"management.metrics.data.repository.metric-name=datarepo"
)
.
withPropertyValues
(
"management.metrics.data.repository.metric-name=datarepo"
).
run
((
context
)
->
{
.
run
((
context
)
->
{
MeterRegistry
registry
=
getInitializedMeterRegistry
(
context
,
ExampleRepository
.
class
);
MeterRegistry
registry
=
getInitializedMeterRegistry
(
context
,
ExampleRepository
.
class
);
Timer
timer
=
registry
.
get
(
"datarepo"
).
timer
();
Timer
timer
=
registry
.
get
(
"datarepo"
).
timer
();
assertThat
(
timer
).
isNotNull
();
assertThat
(
timer
).
isNotNull
();
...
@@ -103,11 +102,8 @@ class RepositoryMetricsAutoConfigurationTests {
...
@@ -103,11 +102,8 @@ class RepositoryMetricsAutoConfigurationTests {
@Test
@Test
void
autoTimeRequestsCanBeConfigured
()
{
void
autoTimeRequestsCanBeConfigured
()
{
this
.
contextRunner
.
withUserConfiguration
(
TestController
.
class
)
this
.
contextRunner
.
withPropertyValues
(
"management.metrics.data.repository.autotime.enabled=true"
,
.
withPropertyValues
(
"management.metrics.data.repository.autotime.enabled=true"
,
"management.metrics.data.repository.autotime.percentiles=0.5,0.7"
).
run
((
context
)
->
{
"management.metrics.data.repository.autotime.percentiles=0.5,0.7"
,
"management.metrics.data.repository.autotime.percentiles-histogram=true"
)
.
run
((
context
)
->
{
MeterRegistry
registry
=
getInitializedMeterRegistry
(
context
,
ExampleRepository
.
class
);
MeterRegistry
registry
=
getInitializedMeterRegistry
(
context
,
ExampleRepository
.
class
);
Timer
timer
=
registry
.
get
(
"spring.data.repository.invocations"
).
timer
();
Timer
timer
=
registry
.
get
(
"spring.data.repository.invocations"
).
timer
();
HistogramSnapshot
snapshot
=
timer
.
takeSnapshot
();
HistogramSnapshot
snapshot
=
timer
.
takeSnapshot
();
...
@@ -130,7 +126,7 @@ class RepositoryMetricsAutoConfigurationTests {
...
@@ -130,7 +126,7 @@ class RepositoryMetricsAutoConfigurationTests {
}
}
private
MeterRegistry
getInitializedMeterRegistry
(
AssertableApplicationContext
context
,
private
MeterRegistry
getInitializedMeterRegistry
(
AssertableApplicationContext
context
,
Class
<?>
repositoryInterface
)
throws
Exception
{
Class
<?>
repositoryInterface
)
{
MetricsRepositoryMethodInvocationListener
listener
=
context
MetricsRepositoryMethodInvocationListener
listener
=
context
.
getBean
(
MetricsRepositoryMethodInvocationListener
.
class
);
.
getBean
(
MetricsRepositoryMethodInvocationListener
.
class
);
ReflectionUtils
.
doWithLocalMethods
(
repositoryInterface
,
(
method
)
->
{
ReflectionUtils
.
doWithLocalMethods
(
repositoryInterface
,
(
method
)
->
{
...
...
spring-boot-project/spring-boot-actuator/build.gradle
View file @
182b75a1
...
@@ -48,7 +48,7 @@ dependencies {
...
@@ -48,7 +48,7 @@ dependencies {
optional
(
"org.mongodb:mongodb-driver-reactivestreams"
)
optional
(
"org.mongodb:mongodb-driver-reactivestreams"
)
optional
(
"org.mongodb:mongodb-driver-sync"
)
optional
(
"org.mongodb:mongodb-driver-sync"
)
optional
(
"org.neo4j.driver:neo4j-java-driver"
)
optional
(
"org.neo4j.driver:neo4j-java-driver"
)
optional
(
"org.quartz-scheduler:quartz"
)
optional
(
"org.quartz-scheduler:quartz"
)
optional
(
"org.springframework:spring-jdbc"
)
optional
(
"org.springframework:spring-jdbc"
)
optional
(
"org.springframework:spring-messaging"
)
optional
(
"org.springframework:spring-messaging"
)
optional
(
"org.springframework:spring-webflux"
)
optional
(
"org.springframework:spring-webflux"
)
...
...
spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/annotation/TimedAnnotations.java
View file @
182b75a1
...
@@ -36,13 +36,13 @@ import org.springframework.util.ConcurrentReferenceHashMap;
...
@@ -36,13 +36,13 @@ import org.springframework.util.ConcurrentReferenceHashMap;
*/
*/
public
final
class
TimedAnnotations
{
public
final
class
TimedAnnotations
{
private
static
Map
<
AnnotatedElement
,
Set
<
Timed
>>
cache
=
new
ConcurrentReferenceHashMap
<>();
private
static
final
Map
<
AnnotatedElement
,
Set
<
Timed
>>
cache
=
new
ConcurrentReferenceHashMap
<>();
private
TimedAnnotations
()
{
private
TimedAnnotations
()
{
}
}
/**
/**
* Return {@link Timed} annotation that should be used for the given {@code method}
* Return {@link Timed} annotation
s
that should be used for the given {@code method}
* and {@code type}.
* and {@code type}.
* @param method the source method
* @param method the source method
* @param type the source type
* @param type the source type
...
...
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ServerProperties.java
View file @
182b75a1
...
@@ -380,7 +380,7 @@ public class ServerProperties {
...
@@ -380,7 +380,7 @@ public class ServerProperties {
/**
/**
* Maximum number of HTTP requests that can be pipelined before the connection is
* Maximum number of HTTP requests that can be pipelined before the connection is
* closed. When set to 0 or 1, keep-alive and pipelining are disabled. When set to
* closed. When set to 0 or 1, keep-alive and pipelining are disabled. When set to
* -1, an unlimited number of pipelined or keep-alive requests
is
allowed.
* -1, an unlimited number of pipelined or keep-alive requests
are
allowed.
*/
*/
private
int
maxKeepAliveRequests
=
100
;
private
int
maxKeepAliveRequests
=
100
;
...
...
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/ServerPropertiesTests.java
View file @
182b75a1
...
@@ -227,7 +227,6 @@ class ServerPropertiesTests {
...
@@ -227,7 +227,6 @@ class ServerPropertiesTests {
@Test
@Test
void
testCustomizeTomcatKeepAliveTimeoutWithInfinite
()
{
void
testCustomizeTomcatKeepAliveTimeoutWithInfinite
()
{
bind
(
"server.tomcat.keep-alive-timeout"
,
"-1"
);
bind
(
"server.tomcat.keep-alive-timeout"
,
"-1"
);
assertThat
(
this
.
properties
.
getTomcat
().
getKeepAliveTimeout
().
toMillis
()).
isEqualTo
(-
1
);
assertThat
(
this
.
properties
.
getTomcat
().
getKeepAliveTimeout
()).
hasMillis
(-
1
);
assertThat
(
this
.
properties
.
getTomcat
().
getKeepAliveTimeout
()).
hasMillis
(-
1
);
}
}
...
...
spring-boot-project/spring-boot-docs/src/docs/asciidoc/production-ready-features.adoc
View file @
182b75a1
...
@@ -2154,7 +2154,7 @@ The following JVM metrics are provided:
...
@@ -2154,7 +2154,7 @@ The following JVM metrics are provided:
[[production-ready-metrics-system]]
[[production-ready-metrics-system]]
==== System Metrics
==== System Metrics
Auto-configuration will enable system metrics using core Micrometer classes.
Auto-configuration will enable system metrics using core Micrometer classes.
System are published under the `system.` and `process.` meter names.
System
metrics
are published under the `system.` and `process.` meter names.
The following system metrics are provided:
The following system metrics are provided:
...
...
spring-boot-project/spring-boot-docs/src/docs/asciidoc/spring-boot-features.adoc
View file @
182b75a1
...
@@ -567,7 +567,7 @@ If `spring.config.location` contains directories (as opposed to files), they mus
...
@@ -567,7 +567,7 @@ If `spring.config.location` contains directories (as opposed to files), they mus
At runtime they will be appended with the names generated from `spring.config.name` before being loaded.
At runtime they will be appended with the names generated from `spring.config.name` before being loaded.
If `spring.config.location` contains files, they are used as-is.
If `spring.config.location` contains files, they are used as-is.
Whether specified directly or contained in a directory, file
s
references must include a file extension in their name.
Whether specified directly or contained in a directory, file references must include a file extension in their name.
Typical extensions that are supported out-of-the-box are `.properties`, `.yaml`, and `.yml`.
Typical extensions that are supported out-of-the-box are `.properties`, `.yaml`, and `.yml`.
When multiple locations are specified, the later ones can override the values of earlier ones.
When multiple locations are specified, the later ones can override the values of earlier ones.
...
...
spring-boot-project/spring-boot/src/test/java/org/springframework/boot/cloud/CloudPlatformTests.java
View file @
182b75a1
...
@@ -151,9 +151,9 @@ class CloudPlatformTests {
...
@@ -151,9 +151,9 @@ class CloudPlatformTests {
}
}
@Test
@Test
void
getActiveWhenHasWebsitesEnableAppServiceStorageAndNoWebsiteNameShouldNotReturnAzureAppService
()
{
void
getActiveWhenHasWebsitesEnableAppServiceStorageAndNoWebsite
Site
NameShouldNotReturnAzureAppService
()
{
Environment
environment
=
getEnvironmentWithEnvVariables
(
Environment
environment
=
getEnvironmentWithEnvVariables
(
Collections
.
singletonMap
(
"WEBSITES_ENABLE_APP_SERVICE_STORAGE"
,
"
---
"
));
Collections
.
singletonMap
(
"WEBSITES_ENABLE_APP_SERVICE_STORAGE"
,
"
false
"
));
CloudPlatform
platform
=
CloudPlatform
.
getActive
(
environment
);
CloudPlatform
platform
=
CloudPlatform
.
getActive
(
environment
);
assertThat
(
platform
).
isNull
();
assertThat
(
platform
).
isNull
();
}
}
...
...
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