KLL sketch
A KLL sketch is a randomized streaming summary that uses weighted compaction to estimate quantiles or ranks with an additive rank-error contract.
Compaction retains weighted representatives instead of every input value. The error concerns positions in the ordered observations, not milliseconds. The original paper distinguishes single-query from all-query guarantees and separates mergeable and non-mergeable constructions; do not combine their strongest properties. [1]
A narrow rank interval can cross a large gap in values. DDSketch instead targets relative-value accuracy. Neither contract is automatically a confidence interval for a wider population. [3] [2]
With duplicate values, several sorted positions share one value. Record inclusive/exclusive rank and the quantile selection convention. [4]
Hesela's exact constructed example has 10,000 distinct durations. Its nearest-rank p99 is 10 ms, while the next observation is 1000 ms at rank 0.9901. This is synthetic arithmetic, not an observed KLL output or a device benchmark. No k setting or failure probability is inferred. [5]
Relations
- related
- Quantile sketch, Quantile, DDSketch, Latency histogram bin
Citations
- Karnin, Lang and Liberty. Optimal Quantile Approximation in Streams (2016), definitions 1-2, sections 2 and 4, Table 1. arXiv:1603.05346.
- Masson, Rim and Lee. DDSketch. PVLDB 12(12), 2195-2205 (2019), section 1 and definition 1. DOI 10.14778/3352063.3352135.
- Apache DataSketches: Understanding KLL Bounds, discontinuities and error dimensions.
- Apache DataSketches: Sketching Quantiles and Ranks Tutorial, duplicates and inclusive/exclusive ranks.
- Hesela: p99 accuracy, rank error is not latency error. Constructed example and downloadable tests.
Sources & caveats
- Primary-source synthesis and exact synthetic arithmetic. No KLL execution or storage benchmark.