Struct windowed_stats::experimental::series::SamplingInterval
source · pub struct SamplingInterval { /* private fields */ }
Expand description
A time interval in which samples are folded into an aggregation.
Sampling intervals determine the timing of aggregations and interpolation in time series and are defined by the following quantities:
- Maximum sampling period. This is the basic unit of time that defines the sampling interval and represents the maximum duration in which a sample must be observed. For any such duration in which no sample is observed, an interpolated sample is used instead. This can also be thought of as its inverse: the minimum sampling frequency.
- Sampling period count. This is the number of sampling periods that form the sampling interval. This determines the minimum number of samples (interpolated or otherwise) folded into the aggregation for the sampling interval.
- Capacity. This is the number of sampling intervals (and therefore aggregations) that must be stored to represent an aggregated series. This quantity is somewhat extrinsic to the time interval itself, but determines its durability.
These quantities are concatenated into a shorthand to describe sampling intervals, formatted
as capacity x sampling_period_count x maximum_sampling_period
. For example, a 10x2x5s
sampling interval persists 10 intervals formed from two maximum sampling period of 5s. In such
an interval, there is at least one sample every 5s, an aggregation every 10s, and at most 10
aggregations that represent a 100s period.
Implementations§
source§impl SamplingInterval
impl SamplingInterval
sourcepub fn durability(&self) -> Duration
pub fn durability(&self) -> Duration
Gets the durability of the interval.
Durability is the maximum period of time represented by the aggregations of a sampling interval. This is the time period for which it represents historical data.
sourcepub fn duration(&self) -> Duration
pub fn duration(&self) -> Duration
Gets the duration of the interval (also known as the aggregation period).
sourcepub fn max_sampling_period(&self) -> Duration
pub fn max_sampling_period(&self) -> Duration
Gets the maximum sampling period of the interval.
Trait Implementations§
source§impl Clone for SamplingInterval
impl Clone for SamplingInterval
source§fn clone(&self) -> SamplingInterval
fn clone(&self) -> SamplingInterval
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for SamplingInterval
impl Debug for SamplingInterval
source§impl Display for SamplingInterval
impl Display for SamplingInterval
source§impl From<SamplingInterval> for SamplingProfile
impl From<SamplingInterval> for SamplingProfile
source§fn from(interval: SamplingInterval) -> Self
fn from(interval: SamplingInterval) -> Self
source§impl Hash for SamplingInterval
impl Hash for SamplingInterval
source§impl PartialEq for SamplingInterval
impl PartialEq for SamplingInterval
source§fn eq(&self, other: &SamplingInterval) -> bool
fn eq(&self, other: &SamplingInterval) -> bool
self
and other
values to be equal, and is used
by ==
.impl Copy for SamplingInterval
impl Eq for SamplingInterval
impl StructuralPartialEq for SamplingInterval
Auto Trait Implementations§
impl Freeze for SamplingInterval
impl RefUnwindSafe for SamplingInterval
impl Send for SamplingInterval
impl Sync for SamplingInterval
impl Unpin for SamplingInterval
impl UnwindSafe for SamplingInterval
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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)