pub struct HistogramBin {
pub lower: Duration,
pub upper: Duration,
pub count: usize,
}Expand description
One bin of a sample-distribution histogram.
Returned by BenchmarkResult::histogram. Bins are ordered, the
first bin’s lower equals BenchmarkResult::min and the last
bin’s upper equals BenchmarkResult::max.
§Example
use dev_bench::Benchmark;
let mut b = Benchmark::new("h");
for _ in 0..10 { b.iter(|| std::hint::black_box(1 + 1)); }
let bins = b.finish().histogram(4);
assert!(bins.iter().all(|b| b.lower <= b.upper));Fields§
§lower: DurationInclusive lower bound of this bin.
upper: DurationInclusive upper bound (for the last bin) or exclusive upper bound (for all other bins).
count: usizeNumber of samples falling into this bin.
Trait Implementations§
Source§impl Clone for HistogramBin
impl Clone for HistogramBin
Source§fn clone(&self) -> HistogramBin
fn clone(&self) -> HistogramBin
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for HistogramBin
impl Debug for HistogramBin
Source§impl PartialEq for HistogramBin
impl PartialEq for HistogramBin
Source§fn eq(&self, other: &HistogramBin) -> bool
fn eq(&self, other: &HistogramBin) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Copy for HistogramBin
impl Eq for HistogramBin
impl StructuralPartialEq for HistogramBin
Auto Trait Implementations§
impl Freeze for HistogramBin
impl RefUnwindSafe for HistogramBin
impl Send for HistogramBin
impl Sync for HistogramBin
impl Unpin for HistogramBin
impl UnsafeUnpin for HistogramBin
impl UnwindSafe for HistogramBin
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more