We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 078e542 commit 0d5c30fCopy full SHA for 0d5c30f
spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/VanillaPublicMetrics.java
@@ -40,10 +40,12 @@
40
public class VanillaPublicMetrics implements PublicMetrics {
41
42
private final MetricReader reader;
43
+ private long timestamp;
44
45
public VanillaPublicMetrics(MetricReader reader) {
46
Assert.notNull(reader, "MetricReader must not be null");
47
this.reader = reader;
48
+ this.timestamp = System.currentTimeMillis();
49
}
50
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
79
.getRuntimeMXBean().getUptime())));
80
+ result.add(new Metric<Long>("instance.uptime", System.currentTimeMillis()
81
+ - this.timestamp));
82
83
84
/**
0 commit comments