Add thread total started count to SystemPublicMetrics

See gh-4356
pull/4356/merge
邱占波 9 years ago committed by Stephane Nicoll
parent cce498b530
commit 35417622e6

@ -119,6 +119,8 @@ public class SystemPublicMetrics implements PublicMetrics, Ordered {
(long) threadMxBean.getPeakThreadCount())); (long) threadMxBean.getPeakThreadCount()));
result.add(new Metric<Long>("threads.daemon", result.add(new Metric<Long>("threads.daemon",
(long) threadMxBean.getDaemonThreadCount())); (long) threadMxBean.getDaemonThreadCount()));
result.add(new Metric<Long>("threads.totalStarted",
threadMxBean.getTotalStartedThreadCount()));
result.add(new Metric<Long>("threads", (long) threadMxBean.getThreadCount())); result.add(new Metric<Long>("threads", (long) threadMxBean.getThreadCount()));
} }

@ -52,6 +52,7 @@ public class SystemPublicMetricsTests {
assertTrue(results.containsKey("threads.peak")); assertTrue(results.containsKey("threads.peak"));
assertTrue(results.containsKey("threads.daemon")); assertTrue(results.containsKey("threads.daemon"));
assertTrue(results.containsKey("threads.totalStarted"));
assertTrue(results.containsKey("threads")); assertTrue(results.containsKey("threads"));
assertTrue(results.containsKey("classes.loaded")); assertTrue(results.containsKey("classes.loaded"));

Loading…
Cancel
Save