AdaptiveTimeWeightedBatchMeans

class AdaptiveTimeWeightedBatchMeans(initialBatchInterval: Duration = 1.milliseconds, targetBatches: Int = 32) : AdaptiveBatchMeans

For continuous metrics, weight new samples by time and do batch means.

Constructors

Link copied to clipboard
constructor(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, value: Double)

Add a new value at currentTime