File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed
spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change 40
40
public class VanillaPublicMetrics implements PublicMetrics {
41
41
42
42
private final MetricReader reader ;
43
+ private long timestamp ;
43
44
44
45
public VanillaPublicMetrics (MetricReader reader ) {
45
46
Assert .notNull (reader , "MetricReader must not be null" );
46
47
this .reader = reader ;
48
+ this .timestamp = System .currentTimeMillis ();
47
49
}
48
50
49
51
@ Override
@@ -75,6 +77,8 @@ protected void addMetrics(Collection<Metric<?>> result) {
75
77
// Add JVM uptime in ms
76
78
result .add (new Metric <Long >("uptime" , new Long (ManagementFactory
77
79
.getRuntimeMXBean ().getUptime ())));
80
+ result .add (new Metric <Long >("instance.uptime" , System .currentTimeMillis ()
81
+ - this .timestamp ));
78
82
}
79
83
80
84
/**
You can’t perform that action at this time.
0 commit comments