CountStat
Observation count: each update contributes 1 regardless of supplied value and weight.
Use cases: event rate denominators, sample sizes, "how many".
Memory: O(1).
Update: O(1).
Concurrency: Inherits SumStat's concurrency model.
Constructors
CountStat
Properties
Thread-safety mode fixed at construction. See Concurrency for the shared contract and the implementation's KDoc for its cell and lock strategy.
Functions
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.
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.
Return the current result evaluated at timestampNanos. Time-independent statistics ignore the timestamp. Reading does not add an observation.
Restore the configured baseline, including any prior seed. Preserves the configuration and concurrency.