Skip to main content

WalltimeBenchmark

Struct WalltimeBenchmark 

Source
pub struct WalltimeBenchmark { /* private fields */ }

Implementations§

Source§

impl WalltimeBenchmark

Source

pub fn collect_raw_walltime_results( scope: &str, name: String, uri: String, iters_per_round: Vec<u128>, times_per_round_ns: Vec<u128>, max_time_ns: Option<u128>, )

Entry point called in patched integration to harvest raw walltime data

CODSPEED_CARGO_WORKSPACE_ROOT is expected to be set for this to work

§Arguments
  • scope: The used integration, e.g. “divan” or “criterion”
  • name: The name of the benchmark
  • uri: The URI of the benchmark
  • iters_per_round: The number of iterations for each round (=sample_size), e.g. [1, 2, 3] (variable) or [2, 2, 2, 2] (constant).
  • times_per_round_ns: The measured time for each round in nanoseconds, e.g. [1000, 2000, 3000]
  • max_time_ns: The time limit for the benchmark in nanoseconds (if defined)
§Pseudo-code
let sample_count = /* The number of executions for the same benchmark. */
let sample_size = iters_per_round = vec![/* The number of iterations within each sample. */];
for round in 0..sample_count {
    let times_per_round_ns = 0;
    for iteration in 0..sample_size[round] {
        run_benchmark();
        times_per_round_ns += /* measured execution time */;
    }
}
Source

pub fn from_runtime_data( name: String, uri: String, iters_per_round: Vec<u128>, times_per_round_ns: Vec<u128>, max_time_ns: Option<u128>, ) -> Self

Source

pub fn is_invalid(&self) -> bool

Source

pub fn name(&self) -> &str

Trait Implementations§

Source§

impl Debug for WalltimeBenchmark

Source§

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

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

impl<'de> Deserialize<'de> for WalltimeBenchmark

Source§

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 Serialize for WalltimeBenchmark

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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,