Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add docs for VirtualThreadMetrics #5610

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions docs/modules/ROOT/pages/reference/jvm.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,14 @@ another. The reported value underestimates the actual total number of steals whe
* `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.
* `executor.parallelism` (`Gauge`): The targeted parallelism level of this pool.
* `executor.pool.size` (`Gauge`): The current number of threads in the pool.

== Java 21 Metrics

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:

[source, java]
----
new VirtualThreadMetrics().bindTo(registry);
----

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.