HeavyHittersResult
Space-Saving heavy-hitters snapshot. keys, counts, errors are parallel arrays of length <= capacity. totalSeen is the unweighted update count.
The true weighted count of a tracked key lies in [counts[i] - errors[i], counts[i] + deficit]. Each bound closes one direction, and which one is slack depends on policy:
Under AdmissionPolicy.Classic a count can only overestimate. errors carries the per-key bound inherited from the evicted minimum, and deficit is zero.
Under AdmissionPolicy.MisraGries a count can only underestimate, because it is only ever incremented exactly or decremented in bulk. errors is zero - correctly, not for want of a bound - and deficit carries the number of decrement rounds, which bounds the shortfall for every key.
A merge that mixes the two accumulates deficit and degrades policy, so both bounds stay sound.
Constructors
HeavyHittersResult
Properties
capacity
counts
deficit
errors
keys
policy
Which algorithm produced these counts, and so which direction their slack runs in.
totalSeen
totalWeights
Cumulative weight of observations folded into this result.
True when totalWeights is not positive, including zero, negative values, and NaN.