TimeMatrix

Struct TimeMatrix 

Source
pub struct TimeMatrix<F, P>{ /* 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>

Source

pub fn new( profile: impl Into<SamplingProfile>, interpolation: P::Output<F::Sample>, ) -> 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::Output<F::Sample>, statistic: F, ) -> Self

Constructs a time matrix with the given statistic.

Source

pub fn fold_and_get_buffers( &mut self, sample: Timed<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>: SerialStatistic<P, Aggregation = A>, F: Default + SerialStatistic<P>, R: Clone + Fn(F::Aggregation) -> A, P: InterpolationKind, A: Clone,

Source

pub fn with_transform( profile: impl Into<SamplingProfile>, interpolation: P::Output<<PostAggregation<F, R> as Statistic>::Sample>, 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>

Source§

fn clone(&self) -> Self

Returns a duplicate 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>

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>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<F, P> Interpolator for TimeMatrix<F, P>

Source§

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

Interpolates samples to the given timestamp. Read more
Source§

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

Interpolates samples to the given timestamp and gets the serialized aggregation buffers. Read more
Source§

impl<F, P> MatrixSampler<<F as Statistic>::Sample> for TimeMatrix<F, P>

Source§

fn fold(&mut self, sample: Timed<F::Sample>) -> Result<(), FoldError>

Auto Trait Implementations§

§

impl<F, P> Freeze for TimeMatrix<F, P>

§

impl<F, P> RefUnwindSafe for TimeMatrix<F, P>

§

impl<F, P> Send for TimeMatrix<F, P>
where <F as SerialStatistic<P>>::Buffer: Send, <P as InterpolationKind>::Output<<F as Statistic>::Sample>: Send, F: Send,

§

impl<F, P> Sync for TimeMatrix<F, P>
where <F as SerialStatistic<P>>::Buffer: Sync, <P as InterpolationKind>::Output<<F as Statistic>::Sample>: Sync, F: Sync,

§

impl<F, P> Unpin for TimeMatrix<F, P>
where <F as SerialStatistic<P>>::Buffer: Unpin, <P as InterpolationKind>::Output<<F as Statistic>::Sample>: Unpin, F: Unpin,

§

impl<F, P> UnwindSafe for TimeMatrix<F, P>

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§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

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

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

Source§

fn __clone_box(&self, _: Private) -> *mut ()

§

impl<T, D> Encode<Ambiguous1, D> for T
where D: ResourceDialect,

§

unsafe fn encode( self, _encoder: &mut Encoder<'_, D>, _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
§

impl<T, D> Encode<Ambiguous2, D> for T
where D: ResourceDialect,

§

unsafe fn encode( self, _encoder: &mut Encoder<'_, D>, _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.

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.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
§

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,

Source§

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

Source§

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

Source§

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<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V