kumulant

VectorStatGroup

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

StatGroup variant over vector inputs.

Constructors

Link copied to clipboard
constructor(stats: List<BoundStat<*, out VectorStat<*>, *>>, concurrency: Concurrency? = null)
constructor(vararg stats: BoundStat<*, out VectorStat<*>, *>, concurrency: Concurrency? = null)
constructor(vararg stats: Pair<StatKey<*>, VectorStat<*>>, concurrency: Concurrency? = null)
constructor(schema: StatSchema, concurrency: Concurrency? = null)

Properties

Link copied to clipboard
override val concurrency: Concurrency

The thread-safety contract this stat was constructed with. Each stat picks the cell-encoding and lock strategy that honours this contract for its mathematical structure:

Functions

Link copied to clipboard
open override fun create(concurrency: Concurrency? = null): VectorStat<GroupResult>

Spawn a fresh accumulator with the same configuration. Optionally override the Concurrency; useful for materialising a wire spec at a different concurrency level than the source.

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

Fold another accumulator's snapshot into this one. The unit of merge is the immutable Result; not a live Stat; which is what lets the merge cross a process boundary. Many workers track slices of the same stream, call read periodically, ship snapshots to a coordinator, and the coordinator merges them in.

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

Materialise the current state as an immutable Result. Reads never mutate, so the caller can read as often as it likes without affecting the stream.

Link copied to clipboard
override fun reset()

Reset the stat to its prior-seeded baseline. Equivalent to constructing a fresh stat with the same configuration, but in place; keeps the same Concurrency and any per-stat tunables.

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

Record a vector observation with the given weight at the current time.

open fun update(vector: DoubleArray, weight: Double = 1.0)

Convenience overload that wraps vector as a DenseVector.

open fun update(vector: DoubleArray, timestampNanos: Long, weight: Double = 1.0)

Timestamped convenience overload that wraps vector as a DenseVector.

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

Record a vector observation at timestampNanos with the given weight.

VectorStatGroup

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

create

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

Spawn a fresh accumulator with the same configuration. Optionally override the Concurrency; useful for materialising a wire spec at a different concurrency level than the source.

The returned stat is independent: its state starts at the configured baseline, not at the source's current state. Each modality subtype narrows the return type so chaining doesn't lose the modality.

update

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

Record a vector observation at timestampNanos with the given weight.