Concurrency
Thread-safety mode for statistical accumulators. Each implementation documents how the mode maps to its cells and locks.
Bare stats default to None. A com.eignex.kumulant.schema.runtime.StatSchema can be materialised with a mode that applies to all of its stats.
None requires a single-threaded owner.
Relaxed uses atomic cells for additive and monotonic stats, permits drift for coupled recurrences, and locks structures that require serialised mutation.
Strict protects coupled recurrences with a lock.
HighWrite uses striped adders for additive JVM stats and behaves like Strict for coupled state and on other platforms.
Atomic updates to individual cells do not guarantee an atomic snapshot of several cells. Check each stat's concurrency documentation when snapshot consistency matters. Floating-point results can vary with update order even when updates are serialised.
Samples
val hits = SumStat(concurrency = Concurrency.HighWrite)
val ols = UnivariateRegressionStat(concurrency = Concurrency.Strict)
hits.update(1.0)
ols.update(x = 1.0, y = 2.0)Entries
Properties
entries
Returns a representation of an immutable list of all enum entries, in the order they're declared.
This method may be used to iterate over the enum entries.
Functions
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
Throws
if this enum type has no constant with the specified name
values
Returns an array containing the constants of this enum type, in the order they're declared.
This method may be used to iterate over the constants.