From 46e4f8bb1c193076ecbb2df76631c6c0d35f8881 Mon Sep 17 00:00:00 2001 From: Phillip Webb Date: Tue, 20 May 2025 18:09:30 -0700 Subject: [PATCH] Fix process into documentation to include virtual threads See gh-45631 --- .../info/InfoEndpointDocumentationTests.java | 22 ++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/info/InfoEndpointDocumentationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/info/InfoEndpointDocumentationTests.java index 89739cf6d23..1590fb076ff 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/info/InfoEndpointDocumentationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/info/InfoEndpointDocumentationTests.java @@ -114,7 +114,27 @@ class InfoEndpointDocumentationTests extends MockMvcEndpointDocumentationTests { fieldWithPath("memory.garbageCollectors").description("Details for garbage collectors."), fieldWithPath("memory.garbageCollectors[].name").description("Name of of the garbage collector."), fieldWithPath("memory.garbageCollectors[].collectionCount") - .description("Total number of collections that have occurred.")); + .description("Total number of collections that have occurred."), + fieldWithPath("virtualThreads") + .description("Virtual thread information (if VirtualThreadSchedulerMXBean is available)") + .type(JsonFieldType.OBJECT) + .optional(), + fieldWithPath("virtualThreads.mounted") + .description("Estimate of the number of virtual threads currently mounted by the scheduler.") + .type(JsonFieldType.NUMBER) + .optional(), + fieldWithPath("virtualThreads.queued").description( + "Estimate of the number of virtual threads queued to the scheduler to start or continue execution.") + .type(JsonFieldType.NUMBER) + .optional(), + fieldWithPath("virtualThreads.parallelism").description("Scheduler's target parallelism.") + .type(JsonFieldType.NUMBER) + .optional(), + fieldWithPath("virtualThreads.poolSize") + .description( + "Current number of platform threads that the scheduler has started but have not terminated") + .type(JsonFieldType.NUMBER) + .optional()); } private ResponseFieldsSnippet javaInfo() {