pub struct TimeWindow {
pub span: Duration,
pub samples: usize,
}Expand description
The span of time one piece of evidence covers (§11.3).
A measurement read from the current sample and a count taken over fifteen samples are both evidence, but they support very different claims, so the window travels with the measurement rather than being described in prose.
Fields§
§span: DurationMonotonic span between the oldest and newest sample the evidence covers.
samples: usizeHow many samples were actually read.
Samples whose input was unavailable are not counted: §26 forbids treating a missing reading as a reading (§8.2).
Implementations§
Source§impl TimeWindow
impl TimeWindow
Sourcepub const CURRENT_SAMPLE: Self
pub const CURRENT_SAMPLE: Self
A single reading from the snapshot being evaluated.
Sourcepub const fn new(span: Duration, samples: usize) -> Self
pub const fn new(span: Duration, samples: usize) -> Self
A window covering samples readings across span.
Sourcepub const fn moving_average(span: Duration) -> Self
pub const fn moving_average(span: Duration) -> Self
A single reading that is itself a moving average, such as a Linux PSI
avg10 figure.
One read of avg10 already summarizes ten seconds of kernel-measured
stall time, so the honest window is those ten seconds even though only one
sample was read.
Sourcepub const fn is_current_sample(&self) -> bool
pub const fn is_current_sample(&self) -> bool
Whether this is a single instantaneous reading.
Trait Implementations§
Source§impl Clone for TimeWindow
impl Clone for TimeWindow
Source§fn clone(&self) -> TimeWindow
fn clone(&self) -> TimeWindow
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more