hdrhistogram
High Dynamic Range histogram in native python
What it is and what it does
hdrhistogram is a Python port of the Java HDR Histogram library, designed to record and analyze latency and performance distributions with high precision across a wide dynamic range. It solves the problem of accurately capturing percentile-based performance metrics without the memory overhead of storing every individual measurement; instead, it uses a bucketing strategy that trades a small, controlled amount of precision for dramatic space efficiency.
The package supports recording values with optional correction for coordinated omission (a common measurement bias in latency testing), querying percentiles and statistical summaries, iterating over recorded values in multiple ways, and serializing histograms to portable formats for storage or cross-platform analysis. It includes a command-line tool (dump_hdrh) for inspecting encoded histograms and supports 16-bit, 32-bit, and 64-bit counters. Runtime dependencies are minimal (pbr and setuptools for build support).
Use it for:
- Track API response latencies in production and analyze tail percentiles (p99, p99.9) without storing every request.
- Measure and compare performance distributions across multiple services or time windows by encoding histograms as portable blobs.
- Correct for coordinated omission bias when benchmarking systems under load, ensuring accurate latency reporting.
- Generate percentile distribution tables in .hgrm format for plotting and reporting performance characteristics.
- Aggregate histograms from distributed systems into a central histogram for unified performance analysis.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Records and analyzes high-precision latency and performance distributions using HDR Histogram, a data structure optimized for capturing value ranges with controlled precision loss.
Yes. hdrhistogram is actively maintained, has no known vulnerabilities, and fills a specific need for efficient, precise latency distribution tracking. Install it if you need percentile-based performance analysis or are porting HDR Histogram code from Java or C. The prebuilt wheels make installation straightforward on common platforms; only consider friction if you're on an unsupported architecture.
Install
hdrhistogram on PyPI
pip
pip install hdrhistogramuv
uv add hdrhistogrampoetry
poetry add hdrhistogramInstalling hdrhistogram
Before you install
Medium install friction due to C extension compilation fallback, though prebuilt wheels cover Linux, macOS, and Windows for Python 3.10–3.14. Active maintenance with recent release (66 days old) and no known vulnerabilities.
License in practice
Licensed under Apache Software License (permissive), allowing commercial and private use with minimal restrictions.
Quickstart
pip install hdrhistogram
from hdrhistogram import HdrHistogram
histogram = HdrHistogram(1, 3600000, 2)
histogram.record_value(latency)
percentile_99_9 = histogram.get_value_at_percentile(99.9)
Requires Python 3.10 or later; C compiler needed only if no prebuilt wheel matches your platform.
Verify before relying
- Whether the package's coordinated omission correction is suitable for your specific measurement scenario.
- Performance characteristics and memory overhead when recording millions of values.
- Interoperability guarantees with Java and C HDR Histogram versions beyond V2 format.
Package facts
| License | not declared (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | 2 — pbr, setuptools |
| Maintenance | actively maintained — 66 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 551,525/month — #6,048 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: hdrhistogram-0.10.7-cp310-cp310-macosx_11_0_arm64.whl; hdrhistogram-0.10.7-cp310-cp310-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl; hdrhistogram-0.10.7-cp310-cp310-musllinux_1_2_x86_64.whl; hdrhistogram-0.10.7-cp310-cp310-win32.whl; hdrhistogram-0.10.7-cp310-cp310-win_amd64.whl; hdrhistogram-0.10.7-cp311-cp311-macosx_11_0_arm64.whl; hdrhistogram-0.10.7-cp311-cp311-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl; hdrhistogram-0.10.7-cp311-cp311-musllinux_1_2_x86_64.whl; hdrhistogram-0.10.7-cp311-cp311-win32.whl; hdrhistogram-0.10.7-cp311-cp311-win_amd64.whl; hdrhistogram-0.10.7-cp312-cp312-macosx_11_0_arm64.whl; hdrhistogram-0.10.7-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl; hdrhistogram-0.10.7-cp312-cp312-musllinux_1_2_x86_64.whl; hdrhistogram-0.10.7-cp312-cp312-win32.whl; hdrhistogram-0.10.7-cp312-cp312-win_amd64.whl; hdrhistogram-0.10.7-cp313-cp313-macosx_11_0_arm64.whl; hdrhistogram-0.10.7-cp313-cp313-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl; hdrhistogram-0.10.7-cp313-cp313-musllinux_1_2_x86_64.whl; hdrhistogram-0.10.7-cp313-cp313-win32.whl; hdrhistogram-0.10.7-cp313-cp313-win_amd64.whl
Keywords: hdrhistogram, hdr, histogram, high, dynamic, range
Tags
More Information Analysis packages
A drop-in replacement for Python's standard…
permissive · top 100 on PyPI
pyarrowpyarrow provides Python bindings to Apache…
permissive · top 100 on PyPI
networkxNetworkX provides data structures and…
permissive · top 1,000 on PyPI
snowflake-connector-pythonConnects Python applications to Snowflake data…
permissive · top 1,000 on PyPI
contourpyContourPy calculates contours of 2D…
permissive · top 1,000 on PyPI
snowflake-snowpark-pythonSnowpark Python provides APIs to query and…
permissive · top 1,000 on PyPI
boost-histogramboost-histogram provides Python bindings to…
permissive · top 5,000 on PyPI
histHist provides a user-friendly interface for…
permissive · top 15,000 on PyPI
histoprintHistoprint renders NumPy histograms and…
permissive · top 15,000 on PyPI
uhiUHI defines and documents a standard interface…
permissive · top 15,000 on PyPI
pyperfpyperf is a toolkit for writing, running, and…
permissive · top 15,000 on PyPI
color-matchercolor-matcher transfers color characteristics…
copyleft · top 15,000 on PyPI
tdigestImplements Ted Dunning's t-digest data…
permissive · top 15,000 on PyPI
hepconverthepconvert converts between columnar file…
permissive · top 15,000 on PyPI