BaselineManager

Struct BaselineManager 

Source
pub struct BaselineManager { /* private fields */ }
Expand description

Manages baseline storage in .benches/ directory

Implementations§

Source§

impl BaselineManager

Source

pub fn new() -> Result<Self, Error>

Create a new baseline manager

By default, uses .benches/ in the current directory

Source

pub fn with_root_dir<P: AsRef<Path>>(root_dir: P) -> Result<Self, Error>

Create a baseline manager with a custom root directory

Source

pub fn save_baseline( &self, crate_name: &str, result: &BenchResult, was_regression: bool, ) -> Result<(), Error>

Save a benchmark result as a baseline (creates new timestamped file)

Source

pub fn load_baseline( &self, crate_name: &str, benchmark_name: &str, ) -> Result<Option<BaselineData>, Error>

Load the most recent baseline for a specific benchmark

Source

pub fn has_baseline(&self, crate_name: &str, benchmark_name: &str) -> bool

Check if a baseline exists for a benchmark

Source

pub fn list_runs( &self, crate_name: &str, benchmark_name: &str, ) -> Result<Vec<String>, Error>

List all run timestamps for a specific benchmark

Source

pub fn load_run( &self, crate_name: &str, benchmark_name: &str, timestamp: &str, ) -> Result<Option<BaselineData>, Error>

Load a specific run by timestamp

Source

pub fn list_baselines(&self, crate_name: &str) -> Result<Vec<String>, Error>

List all baselines for a crate

Source

pub fn load_recent_baselines( &self, crate_name: &str, benchmark_name: &str, count: usize, ) -> Result<Vec<BaselineData>, Error>

Load last N baseline runs for a benchmark

Returns the most recent baseline runs in chronological order (oldest first). Excludes runs that were flagged as regressions to keep the baseline clean. This is used for statistical window comparison.

Trait Implementations§

Source§

impl Debug for BaselineManager

Source§

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

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

impl Default for BaselineManager

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

§

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

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

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

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

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

§

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

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

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

§

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> Same for T

Source§

type Output = T

Should always be Self
§

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

§

type Error = Infallible

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

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

Performs the conversion.
§

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

§

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

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

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

Performs the conversion.