Package io.helidon.metrics.systemmeters
Class VThreadSystemMetersProvider
java.lang.Object
io.helidon.metrics.systemmeters.VThreadSystemMetersProvider
- All Implemented Interfaces:
Resumable,MetersProvider,HelidonShutdownHandler
public class VThreadSystemMetersProvider
extends Object
implements MetersProvider, HelidonShutdownHandler, Resumable
Provides system meters for virtual threads using Java Flight Recorder events.
The virtual thread meters are all net changes since this object was initialized during metrics start-up. This currently happens before the server listeners start so the virtual thread data should be fairly accurate.
Further, we track both the number of pinned virtual threads and a distribution summary of their length. That's because distribution summaries reset after a while to manage storage and reduce the contribution of stale samples. Keeping a separate count gives some indication of the level of thread pinning over the entire lifetime of the server.
JFR delivers events in batches. For performance the values we track are stored as longs without concern for concurrent updates which should not happen anyway.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCollection<Meter.Builder<?, ?>> meterBuilders(MetricsFactory metricsFactory) Returns meter builders created using the specifiedMetricsFactory.voidresume()Invoked after restore.voidshutdown()Handle the shutdown work of this component.voidsuspend()Invoked by before suspend.
-
Constructor Details
-
VThreadSystemMetersProvider
public VThreadSystemMetersProvider()For service loading.
-
-
Method Details
-
meterBuilders
Description copied from interface:MetersProviderReturns meter builders created using the specifiedMetricsFactory.- Specified by:
meterBuildersin interfaceMetersProvider- Parameters:
metricsFactory- theMetricsFactorythe provider should use- Returns:
- meter builders
-
shutdown
public void shutdown()Description copied from interface:HelidonShutdownHandlerHandle the shutdown work of this component.- Specified by:
shutdownin interfaceHelidonShutdownHandler
-
suspend
public void suspend()Description copied from interface:ResumableInvoked by before suspend. -
resume
public void resume()Description copied from interface:ResumableInvoked after restore.
-