diff --git a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/SystemPublicMetrics.java b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/SystemPublicMetrics.java index 7e5f90f0c8..4713124287 100644 --- a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/SystemPublicMetrics.java +++ b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/SystemPublicMetrics.java @@ -119,6 +119,8 @@ public class SystemPublicMetrics implements PublicMetrics, Ordered { (long) threadMxBean.getPeakThreadCount())); result.add(new Metric("threads.daemon", (long) threadMxBean.getDaemonThreadCount())); + result.add(new Metric("threads.totalStarted", + threadMxBean.getTotalStartedThreadCount())); result.add(new Metric("threads", (long) threadMxBean.getThreadCount())); } diff --git a/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/SystemPublicMetricsTests.java b/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/SystemPublicMetricsTests.java index 048db5c0d8..b1ae7c66fd 100644 --- a/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/SystemPublicMetricsTests.java +++ b/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/SystemPublicMetricsTests.java @@ -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")); diff --git a/spring-boot-docs/src/main/asciidoc/production-ready-features.adoc b/spring-boot-docs/src/main/asciidoc/production-ready-features.adoc index 6b256b36ba..2e9930b6dd 100644 --- a/spring-boot-docs/src/main/asciidoc/production-ready-features.adoc +++ b/spring-boot-docs/src/main/asciidoc/production-ready-features.adoc @@ -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,