2 stable releases

new 1.0.1 Feb 25, 2026
1.0.0 Nov 17, 2025

#1960 in Encoding

Download history 15/week @ 2025-11-12 581/week @ 2025-11-19 371/week @ 2025-11-26 311/week @ 2025-12-03 754/week @ 2025-12-10 437/week @ 2025-12-17 1195/week @ 2025-12-24 197/week @ 2025-12-31 1907/week @ 2026-01-07 2077/week @ 2026-01-14 2377/week @ 2026-01-21 1847/week @ 2026-01-28 9930/week @ 2026-02-04 24102/week @ 2026-02-11 44041/week @ 2026-02-18

80,643 downloads per month
Used in 6 crates (3 directly)

Apache-2.0

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