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
e545e5aa
Commit
e545e5aa
authored
Jan 24, 2014
by
Phillip Webb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Polish
parent
76b15c44
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
23 additions
and
48 deletions
+23
-48
MetricFilterAutoConfiguration.java
.../actuate/autoconfigure/MetricFilterAutoConfiguration.java
+0
-8
PrefixMetricGroupExporter.java
...oot/actuate/metrics/export/PrefixMetricGroupExporter.java
+0
-2
CompositeMetricReader.java
...rk/boot/actuate/metrics/reader/CompositeMetricReader.java
+11
-9
MetricReader.java
...ngframework/boot/actuate/metrics/reader/MetricReader.java
+0
-3
PrefixMetricReader.java
...ework/boot/actuate/metrics/reader/PrefixMetricReader.java
+0
-1
MultiMetricRepository.java
...oot/actuate/metrics/repository/MultiMetricRepository.java
+0
-3
RedisMetricRepository.java
...tuate/metrics/repository/redis/RedisMetricRepository.java
+0
-2
RichGauge.java
.../springframework/boot/actuate/metrics/rich/RichGauge.java
+2
-5
RichGaugeReader.java
...gframework/boot/actuate/metrics/rich/RichGaugeReader.java
+0
-2
MetricWriter.java
...ngframework/boot/actuate/metrics/writer/MetricWriter.java
+0
-3
SpringApplication.java
...main/java/org/springframework/boot/SpringApplication.java
+10
-10
No files found.
spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/MetricFilterAutoConfiguration.java
View file @
e545e5aa
...
...
@@ -72,14 +72,6 @@ public class MetricFilterAutoConfiguration {
@Order
(
Ordered
.
HIGHEST_PRECEDENCE
)
private
final
class
MetricsFilter
extends
OncePerRequestFilter
{
/*
* (non-Javadoc)
*
* @see
* org.springframework.web.filter.OncePerRequestFilter#doFilterInternal(javax.
* servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse,
* javax.servlet.FilterChain)
*/
@Override
protected
void
doFilterInternal
(
HttpServletRequest
request
,
HttpServletResponse
response
,
FilterChain
chain
)
throws
ServletException
,
...
...
spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/export/PrefixMetricGroupExporter.java
View file @
e545e5aa
...
...
@@ -42,7 +42,6 @@ public class PrefixMetricGroupExporter extends AbstractMetricExporter {
/**
* Create a new exporter for metrics to a writer based on an empty prefix for the
* metric names.
*
* @param reader a reader as the source of metrics
* @param writer the writer to send the metrics to
*/
...
...
@@ -53,7 +52,6 @@ public class PrefixMetricGroupExporter extends AbstractMetricExporter {
/**
* Create a new exporter for metrics to a writer based on a prefix for the metric
* names.
*
* @param reader a reader as the source of metrics
* @param writer the writer to send the metrics to
* @param prefix the prefix for metrics to export
...
...
spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/reader/CompositeMetricReader.java
View file @
e545e5aa
/*
* Copyright 2012-201
3
the original author or authors.
* Copyright 2012-201
4
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.
...
...
@@ -17,26 +17,28 @@
package
org
.
springframework
.
boot
.
actuate
.
metrics
.
reader
;
import
java.util.ArrayList
;
import
java.util.Collection
;
import
java.util.Collections
;
import
java.util.List
;
import
org.springframework.boot.actuate.metrics.Metric
;
/**
* Composite implementation of {@link MetricReader}.
*
* @author Dave Syer
*/
public
class
CompositeMetricReader
implements
MetricReader
{
private
List
<
MetricReader
>
delegates
=
Collections
.
emptyList
();
private
final
List
<
MetricReader
>
readers
=
new
ArrayList
<
MetricReader
>
();
public
void
setDelegates
(
Collection
<
MetricReader
>
delegates
)
{
this
.
delegates
=
new
ArrayList
<
MetricReader
>(
delegates
);
public
CompositeMetricReader
(
MetricReader
...
readers
)
{
for
(
MetricReader
reader
:
readers
)
{
this
.
readers
.
add
(
reader
);
}
}
@Override
public
Metric
<?>
findOne
(
String
metricName
)
{
for
(
MetricReader
delegate
:
this
.
delegate
s
)
{
for
(
MetricReader
delegate
:
this
.
reader
s
)
{
Metric
<?>
value
=
delegate
.
findOne
(
metricName
);
if
(
value
!=
null
)
{
return
value
;
...
...
@@ -48,7 +50,7 @@ public class CompositeMetricReader implements MetricReader {
@Override
public
Iterable
<
Metric
<?>>
findAll
()
{
List
<
Metric
<?>>
values
=
new
ArrayList
<
Metric
<?>>((
int
)
count
());
for
(
MetricReader
delegate
:
this
.
delegate
s
)
{
for
(
MetricReader
delegate
:
this
.
reader
s
)
{
Iterable
<
Metric
<?>>
all
=
delegate
.
findAll
();
for
(
Metric
<?>
value
:
all
)
{
values
.
add
(
value
);
...
...
@@ -60,7 +62,7 @@ public class CompositeMetricReader implements MetricReader {
@Override
public
long
count
()
{
long
count
=
0
;
for
(
MetricReader
delegate
:
this
.
delegate
s
)
{
for
(
MetricReader
delegate
:
this
.
reader
s
)
{
count
+=
delegate
.
count
();
}
...
...
spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/reader/MetricReader.java
View file @
e545e5aa
...
...
@@ -28,7 +28,6 @@ public interface MetricReader {
/**
* Find an instance of the metric with the given name (usually the latest recorded
* value).
*
* @param metricName the name of the metric to find
* @return a metric value or null if there are none with that name
*/
...
...
@@ -36,14 +35,12 @@ public interface MetricReader {
/**
* Find all the metrics known to this reader.
*
* @return all instances of metrics known to this reader
*/
Iterable
<
Metric
<?>>
findAll
();
/**
* The number of metrics known to this reader.
*
* @return the number of metrics
*/
long
count
();
...
...
spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/reader/PrefixMetricReader.java
View file @
e545e5aa
...
...
@@ -27,7 +27,6 @@ public interface PrefixMetricReader {
/**
* Find all metrics whose name starts with the given prefix.
*
* @param prefix the prefix for metric names
* @return all metrics with names starting with the prefix
*/
...
...
spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/repository/MultiMetricRepository.java
View file @
e545e5aa
...
...
@@ -31,7 +31,6 @@ public interface MultiMetricRepository extends PrefixMetricReader {
/**
* Save some metric values and associate them with a group name.
*
* @param group the name of the group
* @param values the metric values to save
*/
...
...
@@ -40,14 +39,12 @@ public interface MultiMetricRepository extends PrefixMetricReader {
/**
* Rest the values of all metrics in the group. Implementations may choose to discard
* the old values.
*
* @param group reset the whole group
*/
void
reset
(
String
group
);
/**
* The names of all the groups known to this repository
*
* @return all available group names
*/
Iterable
<
String
>
groups
();
...
...
spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/repository/redis/RedisMetricRepository.java
View file @
e545e5aa
...
...
@@ -64,7 +64,6 @@ public class RedisMetricRepository implements MetricRepository {
/**
* The prefix for all metrics keys.
*
* @param prefix the prefix to set for all metrics keys
*/
public
void
setPrefix
(
String
prefix
)
{
...
...
@@ -79,7 +78,6 @@ public class RedisMetricRepository implements MetricRepository {
* zset under this key. Defaults to "keys.spring.metrics". REad operations, especially
* {@link #findAll()} and {@link #count()}, will be much more efficient if the key is
* unique to the {@link #setPrefix(String) prefix} of this repository.
*
* @param key the key to set
*/
public
void
setKey
(
String
key
)
{
...
...
spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/rich/RichGauge.java
View file @
e545e5aa
...
...
@@ -46,11 +46,8 @@ public final class RichGauge {
private
double
alpha
;
/**
* Creates an "empty" gauge.
*
* The average, max and min will be zero, but this initial value will not be included
* after the first value has been set on the gauge.
*
* Creates an "empty" gauge. The average, max and min will be zero, but this initial
* value will not be included after the first value has been set on the gauge.
* @param name the name under which the gauge will be stored.
*/
public
RichGauge
(
String
name
)
{
...
...
spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/rich/RichGaugeReader.java
View file @
e545e5aa
...
...
@@ -25,7 +25,6 @@ public interface RichGaugeReader {
/**
* Find a single instance of a rich gauge by name.
*
* @param name the name of the gauge
* @return a rich gauge value
*/
...
...
@@ -33,7 +32,6 @@ public interface RichGaugeReader {
/**
* Find all instances of rich gauge known to this reader.
*
* @return all instances known to this reader
*/
Iterable
<
RichGauge
>
findAll
();
...
...
spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/writer/MetricWriter.java
View file @
e545e5aa
...
...
@@ -28,14 +28,12 @@ public interface MetricWriter {
/**
* Increment the value of a metric (or decrement if the delta is negative). The name
* of the delta is the name of the metric to increment.
*
* @param delta the amount to increment by
*/
void
increment
(
Delta
<?>
delta
);
/**
* Set the value of a metric.
*
* @param value
*/
void
set
(
Metric
<?>
value
);
...
...
@@ -43,7 +41,6 @@ public interface MetricWriter {
/**
* Reset the value of a metric, usually to zero value. Implementations can discard the
* old values if desired, but may choose not to.
*
* @param metricName the name to reset
*/
void
reset
(
String
metricName
);
...
...
spring-boot/src/main/java/org/springframework/boot/SpringApplication.java
View file @
e545e5aa
...
...
@@ -375,22 +375,25 @@ public class SpringApplication {
}
protected
void
handleError
(
ConfigurableApplicationContext
context
,
ApplicationEventMulticaster
multicaster
,
Throwable
ex
,
String
...
args
)
{
ApplicationEventMulticaster
multicaster
,
Throwable
ex
ception
,
String
...
args
)
{
try
{
multicaster
.
multicastEvent
(
new
SpringApplicationErrorEvent
(
this
,
context
,
args
,
ex
));
args
,
ex
ception
));
}
catch
(
Exception
e
)
{
catch
(
Exception
e
x
)
{
// We don't want to fail here and mask the original exception
if
(
this
.
log
.
isDebugEnabled
())
{
this
.
log
.
error
(
"Error handling failed"
,
e
);
this
.
log
.
error
(
"Error handling failed"
,
e
x
);
}
else
{
this
.
log
.
warn
(
"Error handling failed ("
+
e
.
getMessage
()
+
")"
);
this
.
log
.
warn
(
"Error handling failed ("
+
ex
.
getMessage
()
==
null
?
"no error message"
:
ex
.
getMessage
()
+
")"
);
}
}
if
(
context
!=
null
)
{
context
.
close
();
finally
{
if
(
context
!=
null
)
{
context
.
close
();
}
}
}
...
...
@@ -524,7 +527,6 @@ public class SpringApplication {
* @see #setApplicationContextClass(Class)
*/
protected
ConfigurableApplicationContext
createApplicationContext
()
{
Class
<?>
contextClass
=
this
.
applicationContextClass
;
if
(
contextClass
==
null
)
{
try
{
...
...
@@ -538,9 +540,7 @@ public class SpringApplication {
+
"please specify an ApplicationContextClass"
,
ex
);
}
}
return
(
ConfigurableApplicationContext
)
BeanUtils
.
instantiate
(
contextClass
);
}
/**
...
...
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