pub struct PerformanceRegressionTester { /* private fields */ }Expand description
Performance regression testing framework
Implementations§
Source§impl PerformanceRegressionTester
impl PerformanceRegressionTester
Sourcepub fn new<P: AsRef<Path>>(baseline_file: P) -> Self
pub fn new<P: AsRef<Path>>(baseline_file: P) -> Self
Create a new performance regression tester
Sourcepub fn with_thresholds(self, thresholds: RegressionThresholds) -> Self
pub fn with_thresholds(self, thresholds: RegressionThresholds) -> Self
Set custom regression thresholds
Sourcepub fn record_measurement(&mut self, test_name: &str, duration: Duration)
pub fn record_measurement(&mut self, test_name: &str, duration: Duration)
Record a performance measurement
Sourcepub fn benchmark_function<F, R>(
&mut self,
test_name: &str,
iterations: usize,
func: F,
) -> UtilsResult<R>where
F: FnMut() -> R,
pub fn benchmark_function<F, R>(
&mut self,
test_name: &str,
iterations: usize,
func: F,
) -> UtilsResult<R>where
F: FnMut() -> R,
Benchmark a function and record its performance
Sourcepub fn load_baseline(&self) -> UtilsResult<HashMap<String, Vec<f64>>>
pub fn load_baseline(&self) -> UtilsResult<HashMap<String, Vec<f64>>>
Load baseline measurements from file
Sourcepub fn save_baseline(&self) -> UtilsResult<()>
pub fn save_baseline(&self) -> UtilsResult<()>
Save current measurements as new baseline
Sourcepub fn run_regression_tests(&self) -> UtilsResult<Vec<RegressionTestResult>>
pub fn run_regression_tests(&self) -> UtilsResult<Vec<RegressionTestResult>>
Run regression tests against baseline
Sourcepub fn generate_report(&self, results: &[RegressionTestResult]) -> String
pub fn generate_report(&self, results: &[RegressionTestResult]) -> String
Generate a performance report
Sourcepub fn clear_measurements(&mut self)
pub fn clear_measurements(&mut self)
Clear current measurements
Auto Trait Implementations§
impl Freeze for PerformanceRegressionTester
impl RefUnwindSafe for PerformanceRegressionTester
impl Send for PerformanceRegressionTester
impl Sync for PerformanceRegressionTester
impl Unpin for PerformanceRegressionTester
impl UnwindSafe for PerformanceRegressionTester
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more