Skip to content

Commit eb9ea9c

Browse files
Add docs for VirtualThreadMetrics
See #5067
1 parent 30865af commit eb9ea9c

File tree

1 file changed

+11
-0
lines changed
  • docs/modules/ROOT/pages/reference

1 file changed

+11
-0
lines changed

docs/modules/ROOT/pages/reference/jvm.adoc

+11
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,14 @@ another. The reported value underestimates the actual total number of steals whe
4242
* `executor.running` (`Gauge`): An estimate of the number of worker threads that are not blocked but are waiting to join tasks or for other managed synchronization threads.
4343
* `executor.parallelism` (`Gauge`): The targeted parallelism level of this pool.
4444
* `executor.pool.size` (`Gauge`): The current number of threads in the pool.
45+
46+
== Java 21 Metrics
47+
48+
Micrometer provides support for https://openjdk.org/jeps/444[virtual threads] released in Java 21. In order to utilize it, you need to add the `io.micrometer:micrometer-java21` dependency to your classpath to use the binder:
49+
50+
[source, java]
51+
----
52+
new VirtualThreadMetrics().bindTo(registry);
53+
----
54+
55+
The binder measures the duration (and counts the number of events) of virtual threads being pinned; also counts the number of events when starting or unparking a virtual thread failed.

0 commit comments

Comments
 (0)