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 ability for users to configure settings related to virtual threads meters #9653

Merged
merged 8 commits into from
Jan 15, 2025

Conversation

tjquinno
Copy link
Member

@tjquinno tjquinno commented Jan 11, 2025

Description

Resolves #9652

Release Note

Joe - this release note supersedes and expands on the one for the earlier PR #9619 for virtual threads metrics.

Helidon's built-in meters now include new ones for additional thread information.

New meters related to virtual thread usage

  • current number of active virtual threads (disabled by default)
  • total number of virtual thread starts (disabled by default)
  • total number of pinned threads
  • timer (with histogram) of pinned threads' durations
  • number of failed attempts to submit virtual threads to platform threads

New meter related to platform threads

Helidon also now exposes the new system meter thread.starts which displays the total number of platform thread starts performed in the JVM since server start-up.

Configuration

  • metrics.virtual-threads.enabled

    Whether the virtual thread meters features is enabled.

    Default: true

  • metrics.virtual-threads.count.enabled

    The virtual thread count meters are disabled by default for performance reasons. Enable them by setting metrics.virtual-threads.count.enabled=true in configuration, but be aware doing so can degrade the server's performance.

    Default: false

  • metrics.virtual-threads.pinned.threshold

    Helidon tracks pinned thread events only if the duration reaches a threshold. This value is a Duration expression.

    Default: PT0.02S (20 ms)

Overview of the PR changes

  • Some changes to the doc page
  • Add to the blueprint for the config settings mentioned above.
  • In the VThreadSystemMetersProvider class respect the config settings. If virtual threads metrics are disabled the code does not do anything at all with the JFR API which would remove any performance impact from registering for event notifications with JFR. If virtual thread metrics are enabled, create the RecordingStream (as before) but augment the settings by specifying the pinning threshold from the config.
  • Add config tests.

Documentation

Includes updates to the SE and MP metrics guide pages and the generated doc for config.

@tjquinno tjquinno self-assigned this Jan 11, 2025
@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Jan 11, 2025
@tjquinno tjquinno changed the title Add ability for users to assign JFR config name or file Add ability for users to configure settings related to virtual threads meters Jan 14, 2025
@tjquinno tjquinno requested a review from ljnelson January 14, 2025 22:52
@tjquinno tjquinno merged commit 80f0176 into helidon-io:main Jan 15, 2025
58 checks passed
@tjquinno tjquinno deleted the 4.x-vthreads-meters-config branch January 15, 2025 19:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OCA Verified All contributors have signed the Oracle Contributor Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4.x Allow user to influence JFR RecordingStream used for virtual thread meters
2 participants