Files
David Reiss 53f127cc40 Matching fairness: count-min sketch for counting (#8033)
## What changed?
Add new Counter implementations:
- count-min sketch for high cardinality of keys
- hybrid to switch from map to sketch when number of keys gets high
enough

## Why?
Support high cardinality of fairness keys.

## How did you test it?
- [ ] built
- [ ] run locally and tested manually
- [x] covered by existing tests
- [x] added new unit test(s)
- [ ] added new functional test(s)
2025-07-22 16:43:59 +01:00

10 lines
377 B
Go

package counter
type Counter interface {
// GetPass tracks a value per key, which may be lossy or approximate. It increments the
// value by inc and returns the new value. The value returned must be >= base.
GetPass(key string, base, inc int64) int64
// EstimateDistinctKeys returns an estimate of the number of distinct keys in the counter.
EstimateDistinctKeys() int
}