ckms#
Streaming quantiles with targeted error bounds (CKMS).
A pure-OCaml implementation of the Cormode-Korn-Muthukrishnan-Srivastava algorithm for biased quantiles over data streams (ICDE 2005). It estimates the value at chosen quantiles (p50/p90/p99/...) in memory bounded by the number of targets and their precision, not by the number of observations, with a guaranteed rank error per target. A sliding-time-window estimator reports quantiles over recent observations, as a Prometheus summary does; the clock is injected, so the core stays pure and tests drive it with a mock.
Install#
opam install ckms
If opam cannot find the package, it may not yet be released in the public
opam-repository. Add the overlay repository, then install it:
$ opam repo add samoht https://tangled.org/gazagnaire.org/opam-overlay.git
$ opam update
$ opam install ckms
API#
The Ckms module (lib/ckms.mli) is the whole interface: create an estimator
for a set of targets, insert observations, and query the estimated value at a
quantile.
License#
ISC. See LICENSE.md.