Skip to main content

ExportResult

Struct ExportResult 

Source
pub struct ExportResult {
    pub command: String,
    pub bench: String,
    pub subject: String,
    pub version: Option<Option<String>>,
    pub mean: f64,
    pub stddev: Option<f64>,
    pub median: f64,
    pub min: f64,
    pub max: f64,
    pub times: Vec<f64>,
    pub exit_codes: Vec<i32>,
    pub checks: Option<Checks>,
}

Fields§

§command: String

hyperfine’s display name: the subject, or the benchmark for a single-command one.

§bench: String§subject: String§version: Option<Option<String>>

What the subject’s version_cmd printed. Absent when it has none, null when it failed — a subject is still measured and exported without its version.

§mean: f64

Seconds, like hyperfine, not the milliseconds tak records.

§stddev: Option<f64>

null for a single sample, as hyperfine writes it.

§median: f64§min: f64§max: f64§times: Vec<f64>

Every timed sample in seconds, in the order taken.

§exit_codes: Vec<i32>

What each sample exited with, aligned with times. Always one of the subject’s ok_exit_codes (0 unless it says otherwise): a sample that exits with anything else drops its subject rather than being kept. A failed check is not a failed run, and is reported in checks.

§checks: Option<Checks>

The outcome of the subject’s check, when it has one.

Implementations§

Source§

impl ExportResult

Source

pub fn new( bench: &str, subject: &str, command: &str, samples_ms: &[f64], ) -> Self

A result whose samples all exited 0; see Self::with_exit_codes.

Source

pub fn with_exit_codes(self, codes: &[i32]) -> Self

Record what each sample actually exited with, one per sample.

Source

pub fn with_checks(self, samples: &[bool]) -> Self

Attach a subject’s check outcomes, one per sample.

Trait Implementations§

Source§

impl Debug for ExportResult

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Serialize for ExportResult

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.