kumulant

StatGroup

class StatGroup(stats: List<BoundStat<*, out SeriesStat<*>, *>>, concurrency: Concurrency? = null) : AbstractStatGroup<SeriesStat<*>> , SeriesStat<GroupResult> (source)

Fans each update out to a heterogeneous list of SeriesStats and reports their results keyed by name.

Constructors

StatGroup

constructor(stats: List<BoundStat<*, out SeriesStat<*>, *>>, concurrency: Concurrency? = null)(source)
constructor(vararg stats: BoundStat<*, out SeriesStat<*>, *>, concurrency: Concurrency? = null)(source)
constructor(vararg stats: Pair<StatKey<*>, SeriesStat<*>>, concurrency: Concurrency? = null)(source)
constructor(schema: StatSchema, concurrency: Concurrency = Concurrency.None)(source)

Properties

Link copied to clipboard
override val concurrency: Concurrency

The weakest child guarantee; the requested mode applies when constructing fresh children.

Functions

create

open override fun create(concurrency: Concurrency? = null): SeriesStat<GroupResult>(source)

Create an independent accumulator at the configured baseline. A null concurrency preserves this accumulator's mode; a non-null value overrides it. Modality subtypes narrow the return type to preserve the input shape.

Link copied to clipboard
override fun merge(values: GroupResult, timestampNanos: Long = currentTimeNanos())

Fold a compatible snapshot values into this accumulator at timestampNanos. Implementations document whether the combine is exact or approximate and which state the snapshot omits. The source accumulator is unaffected.

Link copied to clipboard
override fun read(timestampNanos: Long = currentTimeNanos()): GroupResult

Return the current result evaluated at timestampNanos. Time-independent statistics ignore the timestamp. Reading does not add an observation.

Link copied to clipboard
override fun reset()

Restore the configured baseline, including any prior seed. Preserves the configuration and concurrency.

Link copied to clipboard
open fun update(value: Double, weight: Double = 1.0)

Record value with weight at the current monotonic time.

open override fun update(value: Double, timestampNanos: Long, weight: Double = 1.0)

Record value with weight at timestampNanos.

Link copied to clipboard
override fun validateMerge(values: GroupResult)

Validate values for merge without changing accumulator state. Containers validate every child before merging any of them. Successful validation checks compatibility; it does not make a concurrent merge transactional.

update

open override fun update(value: Double, timestampNanos: Long, weight: Double = 1.0)(source)

Record value with weight at timestampNanos.