pub struct BaselineStore { /* private fields */ }Available on crate feature
eval only.Expand description
Manages baseline persistence and regression detection.
Implementations§
Source§impl BaselineStore
impl BaselineStore
Sourcepub fn new(path: impl Into<PathBuf>) -> BaselineStore
pub fn new(path: impl Into<PathBuf>) -> BaselineStore
Create a new baseline store at the given path.
Sourcepub fn save(
&self,
eval_set_id: &str,
metrics: &HashMap<String, HashMap<String, f64>>,
) -> Result<(), EvalError>
pub fn save( &self, eval_set_id: &str, metrics: &HashMap<String, HashMap<String, f64>>, ) -> Result<(), EvalError>
Save metrics as a baseline.
Writes the metrics map with a timestamp and eval set identifier to the configured path as pretty-printed JSON.
Sourcepub fn load(&self) -> Result<Option<Baseline>, EvalError>
pub fn load(&self) -> Result<Option<Baseline>, EvalError>
Load existing baseline.
Returns Ok(None) if the baseline file does not exist.
Returns an error only for actual I/O or parse failures.
Sourcepub fn check_regressions(
&self,
current: &HashMap<String, HashMap<String, f64>>,
tolerance: f64,
) -> Result<Vec<Regression>, EvalError>
pub fn check_regressions( &self, current: &HashMap<String, HashMap<String, f64>>, tolerance: f64, ) -> Result<Vec<Regression>, EvalError>
Compare current metrics against baseline and detect regressions.
A regression is detected when baseline_value - current_value > tolerance.
If no baseline file exists, returns an empty vector (no regressions).
Auto Trait Implementations§
impl Freeze for BaselineStore
impl RefUnwindSafe for BaselineStore
impl Send for BaselineStore
impl Sync for BaselineStore
impl Unpin for BaselineStore
impl UnsafeUnpin for BaselineStore
impl UnwindSafe for BaselineStore
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