2 stable releases
| new 1.0.1 | Feb 25, 2026 |
|---|---|
| 1.0.0 | Nov 17, 2025 |
#1960 in Encoding
80,643 downloads per month
Used in 6 crates
(3 directly)
26KB
487 lines
This crate defines a minimal implementation of DDSketch.
DDSketch is a data sketch used to generate percentiles over streaming data using constant memory. A DDSketch is essentially a histogram that partitions the range of positive values into an infinite number of indexed bins whose size grows exponentially. It keeps track of the number of values (or possibly floating-point weights) added to each bin. Negative values are partitioned like positive values, symmetrically to zero. The value zero as well as its close neighborhood that would be mapped to extreme bin indexes is mapped to a specific counter.
libdd-ddsketch
Minimal implementation of Datadog's DDSketch for accurate quantile estimation.
Overview
DDSketch is a data structure for tracking value distributions with guaranteed relative error bounds using constant memory.
Main Features
- Data Insertion: Add values to sketches with optional counts/weights
- Count Queries: Get total count of points in the sketch
- Protobuf Serialization: Encode sketches for transmission to Datadog backend
References
Dependencies
~0.2–1.5MB
~18K SLoC