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
5938c967
Commit
5938c967
authored
Jul 08, 2015
by
Phillip Webb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Polish
parent
9cb2a096
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
51 additions
and
47 deletions
+51
-47
EndpointWebMvcManagementContextConfiguration.java
...nfigure/EndpointWebMvcManagementContextConfiguration.java
+6
-3
HealthEndpoint.java
...springframework/boot/actuate/endpoint/HealthEndpoint.java
+2
-2
MetricExportProperties.java
...k/boot/actuate/metrics/export/MetricExportProperties.java
+42
-42
AggregateMetricsConfiguration.java
...a/sample/metrics/redis/AggregateMetricsConfiguration.java
+1
-0
No files found.
spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/EndpointWebMvcManagementContextConfiguration.java
View file @
5938c967
...
...
@@ -45,6 +45,7 @@ import org.springframework.context.ApplicationContext;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.ConditionContext
;
import
org.springframework.context.annotation.Conditional
;
import
org.springframework.core.env.Environment
;
import
org.springframework.core.type.AnnotatedTypeMetadata
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.StringUtils
;
...
...
@@ -170,20 +171,22 @@ public class EndpointWebMvcManagementContextConfiguration {
}
private
static
class
LogFileCondition
extends
SpringBootCondition
{
@Override
public
ConditionOutcome
getMatchOutcome
(
ConditionContext
context
,
AnnotatedTypeMetadata
metadata
)
{
String
config
=
context
.
getEnvironment
().
resolvePlaceholders
(
"${logging.file:}"
);
Environment
environment
=
context
.
getEnvironment
();
String
config
=
environment
.
resolvePlaceholders
(
"${logging.file:}"
);
if
(
StringUtils
.
hasText
(
config
))
{
return
ConditionOutcome
.
match
(
"Found logging.file: "
+
config
);
}
config
=
context
.
getEnvironment
()
.
resolvePlaceholders
(
"${logging.path:}"
);
config
=
environment
.
resolvePlaceholders
(
"${logging.path:}"
);
if
(
StringUtils
.
hasText
(
config
))
{
return
ConditionOutcome
.
match
(
"Found logging.path: "
+
config
);
}
return
ConditionOutcome
.
noMatch
(
"Found no log file configuration"
);
}
}
}
spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/HealthEndpoint.java
View file @
5938c967
...
...
@@ -61,8 +61,8 @@ public class HealthEndpoint extends AbstractEndpoint<Health> {
}
/**
* Time to live for cached result. This is particularly useful to cache the
*
result of
this endpoint to prevent a DOS attack if it is accessed anonymously.
* Time to live for cached result. This is particularly useful to cache the
result of
* this endpoint to prevent a DOS attack if it is accessed anonymously.
* @return time to live in milliseconds (default 1000)
*/
public
long
getTimeToLive
()
{
...
...
spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/export/MetricExportProperties.java
View file @
5938c967
...
...
@@ -83,10 +83,6 @@ public class MetricExportProperties extends TriggerProperties {
return
this
.
redis
;
}
public
void
setRedis
(
Redis
redis
)
{
this
.
redis
=
redis
;
}
public
Aggregate
getAggregate
()
{
return
this
.
aggregate
;
}
...
...
@@ -95,6 +91,10 @@ public class MetricExportProperties extends TriggerProperties {
this
.
aggregate
=
aggregate
;
}
public
void
setRedis
(
Redis
redis
)
{
this
.
redis
=
redis
;
}
/**
* Find a matching trigger configuration.
* @param name the bean name to match
...
...
@@ -109,6 +109,44 @@ public class MetricExportProperties extends TriggerProperties {
return
this
;
}
public
static
class
Aggregate
{
/**
* Prefix for global repository if active. Should be unique for this JVM, but most
* useful if it also has the form "a.b" where "a" is unique to this logical
* process (this application) and "b" is unique to this physical process. If you
* set spring.application.name elsewhere, then the default will be in the right
* form.
*/
private
String
prefix
=
""
;
/**
* Pattern that tells the aggregator what to do with the keys from the source
* repository. The keys in the source repository are assumed to be period
* separated, and the pattern is in the same format, e.g. "d.d.k.d". Here "d"
* means "discard" and "k" means "keep" the key segment in the corresponding
* position in the source.
*/
private
String
keyPattern
=
""
;
public
String
getPrefix
()
{
return
this
.
prefix
;
}
public
void
setPrefix
(
String
prefix
)
{
this
.
prefix
=
prefix
;
}
public
String
getKeyPattern
()
{
return
this
.
keyPattern
;
}
public
void
setKeyPattern
(
String
keyPattern
)
{
this
.
keyPattern
=
keyPattern
;
}
}
public
static
class
Redis
{
/**
...
...
@@ -161,42 +199,4 @@ public class MetricExportProperties extends TriggerProperties {
}
public
static
class
Aggregate
{
/**
* Prefix for global repository if active. Should be unique for this JVM, but most
* useful if it also has the form "a.b" where "a" is unique to this logical
* process (this application) and "b" is unique to this physical process. If you
* set spring.application.name elsewhere, then the default will be in the right
* form.
*/
private
String
prefix
=
""
;
/**
* Pattern that tells the aggregator what to do with the keys from the source
* repository. The keys in the source repository are assumed to be period
* separated, and the pattern is in the same format, e.g. "d.d.k.d". Here "d"
* means "discard" and "k" means "keep" the key segment in the corresponding
* position in the source.
*/
private
String
keyPattern
=
""
;
public
String
getPrefix
()
{
return
this
.
prefix
;
}
public
void
setPrefix
(
String
prefix
)
{
this
.
prefix
=
prefix
;
}
public
String
getKeyPattern
()
{
return
this
.
keyPattern
;
}
public
void
setKeyPattern
(
String
keyPattern
)
{
this
.
keyPattern
=
keyPattern
;
}
}
}
spring-boot-samples/spring-boot-sample-metrics-redis/src/main/java/sample/metrics/redis/AggregateMetricsConfiguration.java
View file @
5938c967
...
...
@@ -52,4 +52,5 @@ public class AggregateMetricsConfiguration {
repository
.
setKeyPattern
(
this
.
export
.
getAggregate
().
getKeyPattern
());
return
repository
;
}
}
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