kumulant

StatSchema

abstract class StatSchema(val concurrency: Concurrency = Concurrency.None) : Schema<StatSpec> (source)

Declarative, typed schema for a group of stats, layered on top of com.eignex.skema.Schema<StatSpec> so the entries map is wire-serializable.

Subclass and declare stats via the series, paired, vector, discrete, and group delegates; each property exposes a StatKey for typed retrieval from a GroupResult. Every entry is a StatSpec, which means the schema always round-trips through the wire - no live-stat back-door.

If you need an aggregation that isn't wire-expressible (e.g. a filter-wrapped stat), build a StatGroup / *ListStats directly with the vararg Pair constructor - bypass the schema layer entirely.

The schema-level concurrency is the deployment knob: every config materializes via config.materialize(concurrency) inside the StatGroup / *ListStats constructor.

Samples

val telemetry = object : StatSchema(concurrency = Concurrency.Strict) {
    val latencyMean by series(Mean)
    val errorRate by series(Rate)
}
val group = StatGroup(telemetry)
group.update(42.0)
val results = group.read()
println(results[telemetry.latencyMean].mean)

Constructors

Link copied to clipboard
constructor(concurrency: Concurrency = Concurrency.None)

Properties

Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
open fun definition(): SchemaDef<StatSpec>
Link copied to clipboard

Pure-data, serializable view of this schema using kumulant's wire field stats.

StatSchema

constructor(concurrency: Concurrency = Concurrency.None)(source)

concurrency

statSchemaDef

Pure-data, serializable view of this schema using kumulant's wire field stats.