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
7770b924
Commit
7770b924
authored
Nov 07, 2014
by
Johannes Stelzer
Committed by
Phillip Webb
Nov 07, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add systemload.average to SystemPublicMetrics
Fixes gh-1865
parent
55ccd07a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
0 deletions
+4
-0
SystemPublicMetrics.java
...gframework/boot/actuate/endpoint/SystemPublicMetrics.java
+3
-0
SystemPublicMetricsTests.java
...ework/boot/actuate/endpoint/SystemPublicMetricsTests.java
+1
-0
No files found.
spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/SystemPublicMetrics.java
View file @
7770b924
...
...
@@ -35,6 +35,7 @@ import org.springframework.util.StringUtils;
* @author Dave Syer
* @author Christian Dupuis
* @author Stephane Nicoll
* @author Johannes Stelzer
* @since 1.2.0
*/
public
class
SystemPublicMetrics
implements
PublicMetrics
,
Ordered
{
...
...
@@ -74,6 +75,8 @@ public class SystemPublicMetrics implements PublicMetrics, Ordered {
.
getUptime
()));
result
.
add
(
new
Metric
<
Long
>(
"instance.uptime"
,
System
.
currentTimeMillis
()
-
this
.
timestamp
));
result
.
add
(
new
Metric
<
Double
>(
"systemload.average"
,
ManagementFactory
.
getOperatingSystemMXBean
().
getSystemLoadAverage
()));
}
/**
...
...
spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/SystemPublicMetricsTests.java
View file @
7770b924
...
...
@@ -42,6 +42,7 @@ public class SystemPublicMetricsTests {
assertTrue
(
results
.
containsKey
(
"mem.free"
));
assertTrue
(
results
.
containsKey
(
"processors"
));
assertTrue
(
results
.
containsKey
(
"uptime"
));
assertTrue
(
results
.
containsKey
(
"systemload.average"
));
assertTrue
(
results
.
containsKey
(
"heap.committed"
));
assertTrue
(
results
.
containsKey
(
"heap.init"
));
...
...
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