pub struct ClaimBetter<'a> { /* private fields */ }Expand description
Direct-claim “is this candidate better than this baseline on a
registered metric?” comparator, returned by Verdict::claim_better.
The polarity-aware sibling of
crate::vmm::VmResult::better_across_phases for the case where the
test already HOLDS two scalar values (not two phases): it orients
“better” from the metric’s registry-declared polarity, so the SAME
call expresses “candidate beats baseline” for a LowerBetter latency
AND a HigherBetter throughput without the test author naming a
direction. A metric with no lower/higher-better polarity
(TargetValue / Unknown / Informational / an unregistered or
typo’d name) is INCONCLUSIVE (never a silent pass); a non-finite
endpoint is a Fail.
Implementations§
Source§impl<'a> ClaimBetter<'a>
impl<'a> ClaimBetter<'a>
Sourcepub fn than(self, baseline: f64) -> &'a mut Verdict
pub fn than(self, baseline: f64) -> &'a mut Verdict
Pass iff the candidate is STRICTLY better than baseline per the
metric’s polarity (LowerBetter: candidate < baseline;
HigherBetter: candidate > baseline) — any improvement, no margin.
Sourcepub fn than_by(self, baseline: f64, margin: f64) -> &'a mut Verdict
pub fn than_by(self, baseline: f64, margin: f64) -> &'a mut Verdict
Pass iff the candidate improves on baseline by at least
margin, a FRACTION of the baseline (0.10 = 10% better).
than_by(b, 0.0) means “no regression” (at least as good). A
zero baseline is Inconclusive (nothing to scale the margin
against).
Auto Trait Implementations§
impl<'a> Freeze for ClaimBetter<'a>
impl<'a> RefUnwindSafe for ClaimBetter<'a>
impl<'a> Send for ClaimBetter<'a>
impl<'a> Sync for ClaimBetter<'a>
impl<'a> Unpin for ClaimBetter<'a>
impl<'a> !UnwindSafe for ClaimBetter<'a>
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
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>
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