pub struct EffectEstimate {
pub max_effect_ns: f64,
pub credible_interval_ns: (f64, f64),
pub top_quantiles: Vec<TopQuantile>,
}Expand description
Estimated timing effect with credible interval and top quantiles.
This struct summarizes the timing difference between baseline and sample classes. The effect is characterized by the maximum absolute quantile difference across all 9 deciles, with a 95% credible interval and details about which quantiles contribute most to any detected leak.
See spec Section 5.2 (Effect Reporting).
Fields§
§max_effect_ns: f64Posterior mean of max_k |δ_k| in nanoseconds.
This is the maximum absolute timing difference across all 9 deciles, averaged over posterior samples. Positive values indicate detectable timing differences between the two input classes.
credible_interval_ns: (f64, f64)95% credible interval for max|δ| in nanoseconds.
This is a Bayesian credible interval: there is a 95% posterior probability that the true maximum effect lies within this range.
top_quantiles: Vec<TopQuantile>Top 2-3 quantiles by exceedance probability.
When a timing leak is detected, these are the specific quantiles that contribute most to the leak detection. Each entry includes the quantile probability (e.g., 0.9 for 90th percentile), the posterior mean effect, the 95% marginal credible interval, and the exceedance probability.
Empty when no leak is detected or effect is negligible.
Implementations§
Source§impl EffectEstimate
impl EffectEstimate
Sourcepub fn new(
max_effect_ns: f64,
credible_interval_ns: (f64, f64),
top_quantiles: Vec<TopQuantile>,
) -> Self
pub fn new( max_effect_ns: f64, credible_interval_ns: (f64, f64), top_quantiles: Vec<TopQuantile>, ) -> Self
Create a new EffectEstimate with the given values.
Sourcepub fn is_negligible(&self, threshold_ns: f64) -> bool
pub fn is_negligible(&self, threshold_ns: f64) -> bool
Check if the effect is negligible (max effect below threshold).
Sourcepub fn total_effect_ns(&self) -> f64
pub fn total_effect_ns(&self) -> f64
Get the total effect magnitude (same as max_effect_ns for API compatibility).
Trait Implementations§
Source§impl Clone for EffectEstimate
impl Clone for EffectEstimate
Source§fn clone(&self) -> EffectEstimate
fn clone(&self) -> EffectEstimate
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for EffectEstimate
impl Debug for EffectEstimate
Source§impl Default for EffectEstimate
impl Default for EffectEstimate
Source§impl<'de> Deserialize<'de> for EffectEstimate
impl<'de> Deserialize<'de> for EffectEstimate
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for EffectEstimate
impl RefUnwindSafe for EffectEstimate
impl Send for EffectEstimate
impl Sync for EffectEstimate
impl Unpin for EffectEstimate
impl UnwindSafe for EffectEstimate
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.