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
5d5a14e4
Commit
5d5a14e4
authored
Jun 01, 2018
by
Johnny Lim
Committed by
Stephane Nicoll
Jun 01, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make MetricsProperties fields final if possible
Closes gh-13324
parent
77dcbdb1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
25 deletions
+4
-25
MetricsProperties.java
...boot/actuate/autoconfigure/metrics/MetricsProperties.java
+4
-25
No files found.
spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/MetricsProperties.java
View file @
5d5a14e4
...
@@ -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.util.Assert
;
/**
/**
* {@link ConfigurationProperties} for configuring Micrometer-based metrics.
* {@link ConfigurationProperties} for configuring Micrometer-based metrics.
...
@@ -42,7 +41,7 @@ public class MetricsProperties {
...
@@ -42,7 +41,7 @@ public class MetricsProperties {
* Whether meter IDs starting-with the specified name should be enabled. The longest
* Whether meter IDs starting-with the specified name should be enabled. The longest
* match wins, the key `all` can also be used to configure all meters.
* match wins, the key `all` can also be used to configure all meters.
*/
*/
private
Map
<
String
,
Boolean
>
enable
=
new
LinkedHashMap
<>();
private
final
Map
<
String
,
Boolean
>
enable
=
new
LinkedHashMap
<>();
/**
/**
* Common tags that are applied to every meter.
* Common tags that are applied to every meter.
...
@@ -65,11 +64,6 @@ public class MetricsProperties {
...
@@ -65,11 +64,6 @@ public class MetricsProperties {
return
this
.
enable
;
return
this
.
enable
;
}
}
public
void
setEnable
(
Map
<
String
,
Boolean
>
enable
)
{
Assert
.
notNull
(
enable
,
"enable must not be null"
);
this
.
enable
=
enable
;
}
public
Map
<
String
,
String
>
getTags
()
{
public
Map
<
String
,
String
>
getTags
()
{
return
this
.
tags
;
return
this
.
tags
;
}
}
...
@@ -172,14 +166,14 @@ public class MetricsProperties {
...
@@ -172,14 +166,14 @@ public class MetricsProperties {
* this has no effect. The longest match wins, the key `all` can also be used to
* this has no effect. The longest match wins, the key `all` can also be used to
* configure all meters.
* configure all meters.
*/
*/
private
Map
<
String
,
Boolean
>
percentilesHistogram
=
new
LinkedHashMap
<>();
private
final
Map
<
String
,
Boolean
>
percentilesHistogram
=
new
LinkedHashMap
<>();
/**
/**
* Specific computed non-aggregable percentiles to ship to the backend for meter
* Specific computed non-aggregable percentiles to ship to the backend for meter
* IDs starting-with the specified name. The longest match wins, the key `all` can
* IDs starting-with the specified name. The longest match wins, the key `all` can
* also be used to configure all meters.
* also be used to configure all meters.
*/
*/
private
Map
<
String
,
double
[]>
percentiles
=
new
LinkedHashMap
<>();
private
final
Map
<
String
,
double
[]>
percentiles
=
new
LinkedHashMap
<>();
/**
/**
* Specific SLA boundaries for meter IDs starting-with the specified name. The
* Specific SLA boundaries for meter IDs starting-with the specified name. The
...
@@ -188,35 +182,20 @@ public class MetricsProperties {
...
@@ -188,35 +182,20 @@ public class MetricsProperties {
* as a long or as a Duration value (for timer meters, defaulting to ms if no unit
* as a long or as a Duration value (for timer meters, defaulting to ms if no unit
* specified).
* specified).
*/
*/
private
Map
<
String
,
ServiceLevelAgreementBoundary
[]>
sla
=
new
LinkedHashMap
<>();
private
final
Map
<
String
,
ServiceLevelAgreementBoundary
[]>
sla
=
new
LinkedHashMap
<>();
public
Map
<
String
,
Boolean
>
getPercentilesHistogram
()
{
public
Map
<
String
,
Boolean
>
getPercentilesHistogram
()
{
return
this
.
percentilesHistogram
;
return
this
.
percentilesHistogram
;
}
}
public
void
setPercentilesHistogram
(
Map
<
String
,
Boolean
>
percentilesHistogram
)
{
Assert
.
notNull
(
percentilesHistogram
,
"PercentilesHistogram must not be null"
);
this
.
percentilesHistogram
=
percentilesHistogram
;
}
public
Map
<
String
,
double
[]>
getPercentiles
()
{
public
Map
<
String
,
double
[]>
getPercentiles
()
{
return
this
.
percentiles
;
return
this
.
percentiles
;
}
}
public
void
setPercentiles
(
Map
<
String
,
double
[]>
percentiles
)
{
Assert
.
notNull
(
percentiles
,
"Percentiles must not be null"
);
this
.
percentiles
=
percentiles
;
}
public
Map
<
String
,
ServiceLevelAgreementBoundary
[]>
getSla
()
{
public
Map
<
String
,
ServiceLevelAgreementBoundary
[]>
getSla
()
{
return
this
.
sla
;
return
this
.
sla
;
}
}
public
void
setSla
(
Map
<
String
,
ServiceLevelAgreementBoundary
[]>
sla
)
{
Assert
.
notNull
(
sla
,
"SLA must not be null"
);
this
.
sla
=
sla
;
}
}
}
}
}
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