This is a partial port of the Java DDSketch quantile implementation writen by Rust. DDSketch is mergeable, meaning that multiple sketches from distributed systems can be combined in a central node.
It aims at as compatible as possible with Java implementations, here is some features has support:
- CubicallyInterpolatedMapping
- LogarithmicMapping
- CollapsingHighestDense
- CollapsingLowestDense
- UnboundedSizeDenseStore
- Mergeable
- Decode from input
- Encode to output
let mut d = DDSketch::collapsing_lowest_dense(0.02, 100).unwrap();
d.accept(1.0);
d.accept(2.0);
d.accept(3.0);
assert_eq!(d.get_count(), 3.0);
println!("{}", d.get_max().unwrap());
println!("{}", d.get_min().unwrap());
println!("{}", d.get_sum().unwrap());
println!("{}", d.get_average().unwrap());