JvmPerformanceSchedule

class JvmPerformanceSchedule<T : Any>(name: String, plan: PerformancePlan = PerformancePlan(), diagnosticsOwner: Any? = null, beforeSample: (Int) -> Unit = {}, afterOperation: (Int, T) -> Unit = { _, _ -> }, operation: (Int) -> T) : AutoCloseable(source)

Collects one synchronous operation per application-owned scheduling opportunity. The host supplies ticks or callbacks; warm-up counts, sample boundaries and incomplete evidence belong to the kit. Construct, advance, complete and close on the same physical owner thread. An operation must release its own temporary resources, including when warm-up fails. Closing releases callbacks and collector storage, without closing the application fixture.

Constructors

Link copied to clipboard
constructor(name: String, plan: PerformancePlan = PerformancePlan(), diagnosticsOwner: Any? = null, beforeSample: (Int) -> Unit = {}, afterOperation: (Int, T) -> Unit = { _, _ -> }, operation: (Int) -> T)

Functions

Link copied to clipboard

Runs at most one warm-up or measured operation and reports whether all required samples are complete. Scheduling delay, preparation, diagnostics and assertions remain outside the timed operation. Any callback failure closes the interval and propagates; it cannot subsequently publish evidence.

Link copied to clipboard
open override fun close()

Releases retained callbacks, application references and collector storage exactly once.

Link copied to clipboard

Returns detached evidence and transfers the last successful result only after complete collection. Repeated calls detach new evidence; a closed or failed schedule cannot complete.