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>,

source

pub fn new( profile: impl Into<SamplingProfile>, interpolation: P::State<F>, ) -> Self
where F: Default,

Constructs a time matrix with the given sampling profile and interpolation.

Statistics are default initialized.

source

pub fn with_statistic( profile: impl Into<SamplingProfile>, interpolation: P::State<F>, statistic: F, ) -> Self

Constructs a time matrix with the given statistic.

source

pub fn fold_and_get_buffers( &mut self, sample: TimedSample<F::Sample>, ) -> Result<SerializedBuffer, FoldError>
where FoldError: From<F::Error>,

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,

source

pub fn with_transform( profile: impl Into<SamplingProfile>, interpolation: P::State<PostAggregation<F, R>>, transform: R, ) -> Self
where 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,

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
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,

source§

fn fmt(&self, __f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
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,

source§

fn default() -> Self

Returns the “default value” for a type. Read more
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>,

§

type Error = FoldError

source§

fn interpolate(&mut self, timestamp: Timestamp) -> Result<(), Self::Error>

Interpolates samples to the given timestamp. Read more
source§

fn interpolate_and_get_buffers( &mut self, timestamp: Timestamp, ) -> Result<SerializedBuffer, Self::Error>

Interpolates samples to the given timestamp and gets the serialized aggregation buffers. Read more
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>,

§

type Error = FoldError

The type of error that can occur when folding samples into the sampler.
source§

fn fold(&mut self, timed: TimedSample<F::Sample>) -> Result<(), Self::Error>

source§

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> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> Encode<Ambiguous1> for T

source§

unsafe fn encode( self, _encoder: &mut Encoder<'_>, _offset: usize, _depth: Depth, ) -> Result<(), Error>

Encodes the object into the encoder’s buffers. Any handles stored in the object are swapped for Handle::INVALID. Read more
source§

impl<T> Encode<Ambiguous2> for T

source§

unsafe fn encode( self, _encoder: &mut Encoder<'_>, _offset: usize, _depth: Depth, ) -> Result<(), Error>

Encodes the object into the encoder’s buffers. Any handles stored in the object are swapped for Handle::INVALID. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more