A .NET library for high-dynamic-range histograms to accurately record and analyze latency and performance measurements.
HdrHistogram.NET is a .NET library for creating high-dynamic-range histograms to record and analyze latency and performance measurements with high precision. It solves the problem of accurately capturing response time distributions by avoiding reliance on mean or percentile summaries, instead storing all data in a memory-efficient structure. The library is optimized for low-overhead recording, making it suitable for performance-sensitive applications.
Developers and performance engineers building .NET applications who need to measure and analyze latency, response times, or other high-volume metrics with accurate percentile distributions.
Developers choose HdrHistogram.NET for its ability to capture full latency distributions with minimal performance impact, constant memory usage, and support for high dynamic ranges. Its port from the widely-used Java HdrHistogram ensures reliability and alignment with industry best practices for performance measurement.
The .NET port of HdrHistogram
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Records values in as low as 3-6 nanoseconds per sample on modern hardware, enabling high-volume latency measurement without significant overhead, as benchmarked in the README.
Supports tracking from nanoseconds to hours with configurable significant digits (e.g., 3 digits), allowing precise analysis across vast value ranges without dynamic resizing.
Uses a constant memory footprint based on dynamic range and precision settings, avoiding allocation costs during recording or iteration, with fixed sizes detailed in the footprint estimation section.
Includes RecordValueWithExpectedInterval to account for dropped measurements in latency scenarios, ensuring accurate percentile distributions as explained in the 'Corrected vs. Raw' recording section.
Default histograms like LongHistogram are not internally synchronized, forcing developers to manage concurrency manually or use the heavier SynchronizedHistogram variant, adding overhead and complexity.
Setting up proper dynamic range, precision, and unit scaling (e.g., with Stopwatch timestamps and outputValueUnitScalingRatio) requires deep understanding of histogram concepts, which can be error-prone for newcomers.
Output formats are raw (console or files), and charting requires external tools like the provided HTML plotter, lacking direct integration with modern monitoring systems like Grafana or Prometheus.