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
.void
resume()
Invoked after restore.void
shutdown()
Handle the shutdown work of this component.void
suspend()
Invoked by before suspend.
-
Constructor Details
-
VThreadSystemMetersProvider
public VThreadSystemMetersProvider()For service loading.
-
-
Method Details
-
meterBuilders
Description copied from interface:MetersProvider
Returns meter builders created using the specifiedMetricsFactory
.- Specified by:
meterBuilders
in interfaceMetersProvider
- Parameters:
metricsFactory
- theMetricsFactory
the provider should use- Returns:
- meter builders
-
shutdown
public void shutdown()Description copied from interface:HelidonShutdownHandler
Handle the shutdown work of this component.- Specified by:
shutdown
in interfaceHelidonShutdownHandler
-
suspend
public void suspend()Description copied from interface:Resumable
Invoked by before suspend. -
resume
public void resume()Description copied from interface:Resumable
Invoked after restore.
-