Struct windowed_stats::experimental::series::TimeMatrix
source · pub struct TimeMatrix<F, P>where
F: BufferStrategy<F::Aggregation, P> + Statistic,
P: Interpolation<FillSample<F> = F::Sample>,{ /* private fields */ }
Expand description
One or more statistical round-robin time series.
A time matrix is a round-robin multi-resolution time series that samples and interpolates timed data, computes statistical aggregations for elapsed sampling intervals, and buffers those aggregations. The sample data, statistic, and interpolation of series in a time matrix must be the same, but the sampling intervals can and should differ.
Implementations§
source§impl<F, P> TimeMatrix<F, P>where
F: BufferStrategy<F::Aggregation, P> + Statistic,
P: Interpolation<FillSample<F> = F::Sample>,
impl<F, P> TimeMatrix<F, P>where
F: BufferStrategy<F::Aggregation, P> + Statistic,
P: Interpolation<FillSample<F> = F::Sample>,
sourcepub fn new(
profile: impl Into<SamplingProfile>,
interpolation: P::State<F>,
) -> Selfwhere
F: Default,
pub fn new(
profile: impl Into<SamplingProfile>,
interpolation: P::State<F>,
) -> Selfwhere
F: Default,
Constructs a time matrix with the given sampling profile and interpolation.
Statistics are default initialized.
sourcepub fn with_statistic(
profile: impl Into<SamplingProfile>,
interpolation: P::State<F>,
statistic: F,
) -> Self
pub fn with_statistic( profile: impl Into<SamplingProfile>, interpolation: P::State<F>, statistic: F, ) -> Self
Constructs a time matrix with the given statistic.
sourcepub fn fold_and_get_buffers(
&mut self,
sample: TimedSample<F::Sample>,
) -> Result<SerializedBuffer, FoldError>
pub fn fold_and_get_buffers( &mut self, sample: TimedSample<F::Sample>, ) -> Result<SerializedBuffer, FoldError>
Folds the given sample and interpolations and gets the aggregation buffers.
To fold a sample without serializing buffers, use Sampler::fold
.
source§impl<F, R, P, A> TimeMatrix<PostAggregation<F, R>, P>where
PostAggregation<F, R>: BufferStrategy<A, P>,
F: Default + Statistic,
R: Clone + Fn(F::Aggregation) -> A,
P: InterpolationFor<PostAggregation<F, R>>,
A: Clone,
impl<F, R, P, A> TimeMatrix<PostAggregation<F, R>, P>where
PostAggregation<F, R>: BufferStrategy<A, P>,
F: Default + Statistic,
R: Clone + Fn(F::Aggregation) -> A,
P: InterpolationFor<PostAggregation<F, R>>,
A: Clone,
sourcepub fn with_transform(
profile: impl Into<SamplingProfile>,
interpolation: P::State<PostAggregation<F, R>>,
transform: R,
) -> Selfwhere
R: Clone,
pub fn with_transform(
profile: impl Into<SamplingProfile>,
interpolation: P::State<PostAggregation<F, R>>,
transform: R,
) -> Selfwhere
R: Clone,
Constructs a time matrix with the default statistic and given transform for post-aggregation.
Trait Implementations§
source§impl<F, P> Clone for TimeMatrix<F, P>where
F: BufferStrategy<F::Aggregation, P> + Statistic + Clone,
P: Interpolation<FillSample<F> = F::Sample>,
<F as BufferStrategy<Aggregation<F>, P>>::Buffer: Clone,
P::State<F>: Clone,
impl<F, P> Clone for TimeMatrix<F, P>where
F: BufferStrategy<F::Aggregation, P> + Statistic + Clone,
P: Interpolation<FillSample<F> = F::Sample>,
<F as BufferStrategy<Aggregation<F>, P>>::Buffer: Clone,
P::State<F>: Clone,
source§impl<F, P> Debug for TimeMatrix<F, P>where
F: BufferStrategy<F::Aggregation, P> + Statistic + Debug,
P: Interpolation<FillSample<F> = F::Sample>,
F::Sample: Debug,
F::Aggregation: Debug,
<F as BufferStrategy<Aggregation<F>, P>>::Buffer: Debug,
P::State<F>: Debug,
impl<F, P> Debug for TimeMatrix<F, P>where
F: BufferStrategy<F::Aggregation, P> + Statistic + Debug,
P: Interpolation<FillSample<F> = F::Sample>,
F::Sample: Debug,
F::Aggregation: Debug,
<F as BufferStrategy<Aggregation<F>, P>>::Buffer: Debug,
P::State<F>: Debug,
source§impl<F, P> Default for TimeMatrix<F, P>where
F: BufferStrategy<F::Aggregation, P> + Default + Statistic,
P: Interpolation<FillSample<F> = F::Sample>,
P::State<F>: Default,
impl<F, P> Default for TimeMatrix<F, P>where
F: BufferStrategy<F::Aggregation, P> + Default + Statistic,
P: Interpolation<FillSample<F> = F::Sample>,
P::State<F>: Default,
source§impl<F, P> Interpolator for TimeMatrix<F, P>where
FoldError: From<F::Error>,
F: BufferStrategy<F::Aggregation, P> + Statistic,
P: Interpolation<FillSample<F> = F::Sample>,
impl<F, P> Interpolator for TimeMatrix<F, P>where
FoldError: From<F::Error>,
F: BufferStrategy<F::Aggregation, P> + Statistic,
P: Interpolation<FillSample<F> = F::Sample>,
type Error = FoldError
source§fn interpolate(&mut self, timestamp: Timestamp) -> Result<(), Self::Error>
fn interpolate(&mut self, timestamp: Timestamp) -> Result<(), Self::Error>
source§fn interpolate_and_get_buffers(
&mut self,
timestamp: Timestamp,
) -> Result<SerializedBuffer, Self::Error>
fn interpolate_and_get_buffers( &mut self, timestamp: Timestamp, ) -> Result<SerializedBuffer, Self::Error>
source§impl<F, P> Sampler<TimedSample<<F as Statistic>::Sample>> for TimeMatrix<F, P>where
FoldError: From<F::Error>,
F: BufferStrategy<F::Aggregation, P> + Statistic,
P: Interpolation<FillSample<F> = F::Sample>,
impl<F, P> Sampler<TimedSample<<F as Statistic>::Sample>> for TimeMatrix<F, P>where
FoldError: From<F::Error>,
F: BufferStrategy<F::Aggregation, P> + Statistic,
P: Interpolation<FillSample<F> = F::Sample>,
impl<F, P> RoundRobinSampler<<F as Statistic>::Sample> for TimeMatrix<F, P>where
FoldError: From<F::Error>,
F: BufferStrategy<F::Aggregation, P> + Statistic,
P: Interpolation<FillSample<F> = F::Sample>,
Auto Trait Implementations§
impl<F, P> Freeze for TimeMatrix<F, P>
impl<F, P> RefUnwindSafe for TimeMatrix<F, P>where
<F as BufferStrategy<<F as Statistic>::Aggregation, P>>::Buffer: RefUnwindSafe,
<P as Interpolation>::State<F>: RefUnwindSafe,
F: RefUnwindSafe,
impl<F, P> Send for TimeMatrix<F, P>where
<F as BufferStrategy<<F as Statistic>::Aggregation, P>>::Buffer: Send,
<P as Interpolation>::State<F>: Send,
F: Send,
impl<F, P> Sync for TimeMatrix<F, P>where
<F as BufferStrategy<<F as Statistic>::Aggregation, P>>::Buffer: Sync,
<P as Interpolation>::State<F>: Sync,
F: Sync,
impl<F, P> Unpin for TimeMatrix<F, P>where
<F as BufferStrategy<<F as Statistic>::Aggregation, P>>::Buffer: Unpin,
<P as Interpolation>::State<F>: Unpin,
F: Unpin,
impl<F, P> UnwindSafe for TimeMatrix<F, P>where
<F as BufferStrategy<<F as Statistic>::Aggregation, P>>::Buffer: UnwindSafe,
<P as Interpolation>::State<F>: UnwindSafe,
F: UnwindSafe,
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
)