AdaptiveRateBatchMeans

class AdaptiveRateBatchMeans(durationUnit: DurationUnit, initialBatchInterval: Duration = 1.milliseconds, targetBatches: Int = 32) : AdaptiveBatchMeans

Rate Batch means is the correct way to report rate metrics. It does all the heavy lifting of calculating the rates over each batch when events come in.

Constructors

Link copied to clipboard
constructor(durationUnit: DurationUnit, initialBatchInterval: Duration = 1.milliseconds, targetBatches: Int = 32)

Properties

Link copied to clipboard

Target number of batches to maintain after collapsing.

Functions

Link copied to clipboard

Returns the current number of batches.

Link copied to clipboard

Returns the current variance of batch means.

Link copied to clipboard
fun mean(): Double

Returns the current overall mean across all batch means.

Link copied to clipboard
fun onCloseBatch(callback: () -> Unit)

Registers a callback to be invoked each time a batch is closed/finalized.

Link copied to clipboard
fun update(currentTime: Instant)

Updates the batch means with a new event at the given simulation time.