Skip to content

A Rust library for estimating quantiles in a stream, using ClickHouse t-digest data structure.

License

Notifications You must be signed in to change notification settings

vivienm/rust-tdigest-ch

Repository files navigation

tdigest-ch

A Rust library for estimating quantiles in a stream, using ClickHouse t-digest data structure.

The t-digest data structure is designed around computing accurate quantile estimates from streaming data. Two t-digests can be merged, making the data structure well suited for map-reduce settings.

Documentation

Example

use tdigest_ch::TDigest;

let mut digest = TDigest::new();

// Add some elements.
digest.insert(1.0);
digest.insert(2.0);
digest.insert(3.0);

// Get the median of the distribution.
let quantile = digest.quantile(0.5);
assert_eq!(quantile, 2.0);

About

A Rust library for estimating quantiles in a stream, using ClickHouse t-digest data structure.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published