histogram

Latest version: 1.0.0 registry icon
Maintenance score
100
Safety score
100
Popularity score
70
Check your open source dependency risks. Get immediate insight about security, stability and licensing risks.
Security
  Vulnerabilities
Version Suggest Low Medium High Critical
1.0.0 0 0 0 0 0
0.11.5 0 0 0 0 0
0.11.4 0 0 0 0 0
0.11.3 0 0 0 0 0
0.11.2 0 0 0 0 0
0.11.1 0 0 0 0 0
0.11.0 0 0 0 0 0
0.10.2 0 0 0 0 0
0.10.1 0 0 0 0 0
0.10.0 0 0 0 0 0
0.9.1 0 0 0 0 0
0.9.0 0 0 0 0 0
0.8.4 0 0 0 0 0
0.8.3 0 0 0 0 0
0.8.2 0 0 0 0 0
0.8.1 0 0 0 0 0
0.8.0 0 0 0 0 0
0.7.4 0 0 0 0 0
0.7.3 0 0 0 0 0
0.7.2 0 0 0 0 0
0.7.1 0 0 0 0 0
0.7.0 0 0 0 0 0
0.6.9 0 0 0 0 0
0.6.8 0 0 0 0 0
0.6.7 0 0 0 0 0
0.6.6 0 0 0 0 0
0.6.5 0 0 0 0 0
0.6.4 0 0 0 0 0
0.6.3 0 0 0 0 0
0.6.2 0 0 0 0 0
0.6.1 0 0 0 0 0
0.6.0 0 0 0 0 0
0.5.1 0 0 0 0 0
0.5.0 0 0 0 0 0
0.4.0 0 0 0 0 0
0.3.6 0 0 0 0 0
0.3.5 0 0 0 0 0
0.3.4 0 0 0 0 0
0.3.3 0 0 0 0 0
0.3.2 0 0 0 0 0
0.3.1 0 0 0 0 0
0.3.0 0 0 0 0 0
0.2.2 0 0 0 0 0
0.2.1 0 0 0 0 0
0.2.0 0 0 0 0 0
0.1.6 0 0 0 0 0
0.1.5 0 0 0 0 0
0.1.4 0 0 0 0 0
0.1.3 0 0 0 0 0
0.1.2 0 0 0 0 0

Stability
Latest release:

1.0.0 - This version is safe to use because it has no known security vulnerabilities at this time. Find out if your coding project uses this component and get notified of any reported security vulnerabilities with Meterian-X Open Source Security Platform

Licensing

Maintain your licence declarations and avoid unwanted licences to protect your IP the way you intended.

Apache-2.0   -   Apache License 2.0

Not a wildcard

Not proprietary

OSI Compliant


MIT   -   MIT License

Not a wildcard

Not proprietary

OSI Compliant



histogram

A collection of histogram data structures for Rust, providing standard, atomic, and sparse variants. Like HDRHistogram, values are stored in quantized buckets, but the bucket construction and indexing algorithm are modified for fast increments and lookups.

Getting Started

cargo add histogram

Usage

use histogram::Histogram;

// Create a histogram with grouping power 7 and max value power 64.
let mut histogram = Histogram::new(7, 64).unwrap();

// Record some values.
for i in 1..=100 {
    histogram.increment(i).unwrap();
}

// Query percentiles using the 0.0..=1.0 scale.
let median = histogram.percentile(0.5).unwrap().unwrap();
let p99 = histogram.percentile(0.99).unwrap().unwrap();
// percentile() returns Result<Option<Bucket>, Error>
// outer unwrap: percentile value is valid
// inner unwrap: histogram is non-empty

println!("median: {}", median.end());
println!("p99: {}", p99.end());

Histogram Types

  • Histogram -- Standard histogram with plain 64-bit counters. Best for single-threaded use.
  • AtomicHistogram -- Uses atomic 64-bit counters, allowing concurrent recording from multiple threads. Take a snapshot via load() or drain() to query percentiles.
  • SparseHistogram -- Columnar representation that only stores non-zero buckets. Ideal for serialization and storage when most buckets are empty.

Features

  • serde -- Enables Serialize and Deserialize for histogram types.
  • schemars -- Enables JSON Schema generation (implies serde).

Documentation

License

Licensed under either of Apache License, Version 2.0 or MIT license at your option.