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 4040public class VanillaPublicMetrics implements PublicMetrics {
4141
4242 private final MetricReader reader ;
43+ private long timestamp ;
4344
4445 public VanillaPublicMetrics (MetricReader reader ) {
4546 Assert .notNull (reader , "MetricReader must not be null" );
4647 this .reader = reader ;
48+ this .timestamp = System .currentTimeMillis ();
4749 }
4850
4951 @ Override
@@ -75,6 +77,8 @@ protected void addMetrics(Collection<Metric<?>> result) {
7577 // Add JVM uptime in ms
7678 result .add (new Metric <Long >("uptime" , new Long (ManagementFactory
7779 .getRuntimeMXBean ().getUptime ())));
80+ result .add (new Metric <Long >("instance.uptime" , System .currentTimeMillis ()
81+ - this .timestamp ));
7882 }
7983
8084 /**
You can’t perform that action at this time.
0 commit comments