Merge pull request #4356 from bohrqiu/master
* pr/4356: Polish contribution Add thread total started count to SystemPublicMetrics
This commit is contained in:
@@ -119,6 +119,8 @@ public class SystemPublicMetrics implements PublicMetrics, Ordered {
|
||||
(long) threadMxBean.getPeakThreadCount()));
|
||||
result.add(new Metric<Long>("threads.daemon",
|
||||
(long) threadMxBean.getDaemonThreadCount()));
|
||||
result.add(new Metric<Long>("threads.totalStarted",
|
||||
threadMxBean.getTotalStartedThreadCount()));
|
||||
result.add(new Metric<Long>("threads", (long) threadMxBean.getThreadCount()));
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2014 the original author or authors.
|
||||
* Copyright 2012-2015 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -52,6 +52,7 @@ public class SystemPublicMetricsTests {
|
||||
|
||||
assertTrue(results.containsKey("threads.peak"));
|
||||
assertTrue(results.containsKey("threads.daemon"));
|
||||
assertTrue(results.containsKey("threads.totalStarted"));
|
||||
assertTrue(results.containsKey("threads"));
|
||||
|
||||
assertTrue(results.containsKey("classes.loaded"));
|
||||
|
||||
@@ -914,6 +914,7 @@ endpoint you should see a response similar to this:
|
||||
"threads": 15,
|
||||
"threads.daemon": 11,
|
||||
"threads.peak": 15,
|
||||
"threads.totalStarted": 42,
|
||||
"uptime": 494836,
|
||||
"instance.uptime": 489782,
|
||||
"datasource.primary.active": 5,
|
||||
|
||||
Reference in New Issue
Block a user