pub struct BenchMetric { /* private fields */ }Expand description
Timing, throughput, and steady-state allocation telemetry for a single micro- or macro-benchmark.
Implementations§
Source§impl BenchMetric
Constructors and allocation attachment builders for BenchMetric.
impl BenchMetric
Constructors and allocation attachment builders for BenchMetric.
Sourcepub fn from_elapsed(
name: &str,
iterations: usize,
elapsed: Duration,
detail: String,
) -> Self
pub fn from_elapsed( name: &str, iterations: usize, elapsed: Duration, detail: String, ) -> Self
Constructs a BenchMetric from elapsed wall duration and iteration count.
§Arguments
&str- Canonical benchmark metric name.usize- Number of completed measured iterations.Duration- Total elapsed wall duration across iterations.String- Extra verification metadata string.
§Returns
Self- Populated benchmark metric ready for optional allocation attachment.
Sourcepub fn with_allocations(self, snapshot: AllocationSnapshot) -> Self
pub fn with_allocations(self, snapshot: AllocationSnapshot) -> Self
Source§impl BenchMetric
impl BenchMetric
pub fn get_name(&self) -> &String
pub fn get_iterations(&self) -> usize
pub fn get_total_micros(&self) -> u64
pub fn get_ns_per_op(&self) -> f64
pub fn get_ops_per_sec(&self) -> f64
pub fn get_detail(&self) -> &String
pub fn get_alloc_count(&self) -> u64
pub fn get_bytes_allocated(&self) -> u64
pub fn get_allocs_per_op(&self) -> f64
pub fn get_bytes_per_op(&self) -> f64
Trait Implementations§
Source§impl Clone for BenchMetric
impl Clone for BenchMetric
Source§impl Debug for BenchMetric
impl Debug for BenchMetric
Source§impl<'de> Deserialize<'de> for BenchMetric
impl<'de> Deserialize<'de> for BenchMetric
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for BenchMetric
impl PartialEq for BenchMetric
Source§impl Serialize for BenchMetric
impl Serialize for BenchMetric
impl StructuralPartialEq for BenchMetric
Auto Trait Implementations§
impl Forget for BenchMetric
impl Freeze for BenchMetric
impl Move for BenchMetric
impl RefUnwindSafe for BenchMetric
impl Send for BenchMetricwhere
RawVecInner: Send,
impl Sync for BenchMetricwhere
RawVecInner: Sync,
impl Unpin for BenchMetric
impl UnsafeUnpin for BenchMetric
impl UnwindSafe for BenchMetricwhere
RawVecInner: UnwindSafe,
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