RuntimeWorkMonitor

class RuntimeWorkMonitor(owner: Any, checkpointSamples: Int? = null, maxNodeRecords: Int? = null) : AutoCloseable(source)

Compatibility reader for runtimes that expose the former opt-in diagnostic capability. Production runtimes without that capability remain unmodified and report unavailable work metrics. Operations and external elapsed/CPU/allocation measurements still run; work expectations require real counters.

Parameters

owner

the measured runtime diagnostics owner.

checkpointSamples

optional fixed diagnostic window for an existing JMH workload.

maxNodeRecords

optional explicit capacity in 1..65,536; absent preserves the measured runtime's existing default.

Constructors

Link copied to clipboard
constructor(owner: Any, checkpointSamples: Int? = null, maxNodeRecords: Int? = null)

Properties

Link copied to clipboard

Whether the measured runtime supplies actual legacy work counters.

Functions

Link copied to clipboard

Begins a fresh work interval without retaining historical frame evidence.

Link copied to clipboard
open override fun close()

Releases diagnostic ownership without closing the application session.

Link copied to clipboard
fun <T> sample(operation: () -> T): T

Preserves a declared JMH monitoring window without downstream checkpoint scheduling. This records work without adding another timer or changing the JMH harness boundary.

Link copied to clipboard
fun snapshot(): JsonObject

Rejects incomplete node evidence before returning detached counts and retention information.

Link copied to clipboard
fun verify(expectation: WorkExpectation)

Applies declarative work expectations using complete actual invocation counters.