pub enum Interpolator {
Linear,
Nearest,
CatmullRom,
Zero,
Forward,
Nocb,
}Expand description
Interpolation strategy for gap filling.
Variants§
Linear
Linearly interpolated values between known points.
Nearest
Nearest neighbor fill.
CatmullRom
Catmull-Rom spline (C1 local interpolation using 4 surrounding points, falls back to Linear).
§Monotonic timestamps requirement
The Catmull-Rom interpolation assumes that input timestamps are
strictly monotonically increasing. If timestamps are
out-of-order or contain duplicates, the interpolated values will
be incorrect (the parametric t fraction becomes negative or
1). Callers should sort / deduplicate timestamps before interpolation, or apply
ClockDriftStrategy::Monotoniccorrection first.
Zero
Fill with 0.0.
Forward
Last known value carried forward.
Nocb
Next observation carried backward (Nocb).
Implementations§
Source§impl Interpolator
impl Interpolator
Sourcepub fn fill(
&self,
timestamps: &[i64],
values: &[f64],
expected_interval_ns: i64,
) -> Result<(Vec<i64>, Vec<f64>, usize, usize), InterpolationError>
pub fn fill( &self, timestamps: &[i64], values: &[f64], expected_interval_ns: i64, ) -> Result<(Vec<i64>, Vec<f64>, usize, usize), InterpolationError>
Fills gaps in the data using this interpolation method.
timestamps and values are the original (sparse) data.
expected_interval_ns is the expected interval between points.
Returns (filled_timestamps, filled_values, gaps_filled_count, gaps_skipped_count).
gaps_skipped_count reports how many gap segments exceeded
MAX_GAP_FILL and were left unfilled, so callers can detect incomplete
interpolation without parsing logs.
Trait Implementations§
Source§impl Clone for Interpolator
impl Clone for Interpolator
Source§fn clone(&self) -> Interpolator
fn clone(&self) -> Interpolator
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for Interpolator
Source§impl Debug for Interpolator
impl Debug for Interpolator
Source§impl<'de> Deserialize<'de> for Interpolator
impl<'de> Deserialize<'de> for Interpolator
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for Interpolator
Source§impl PartialEq for Interpolator
impl PartialEq for Interpolator
Source§impl Serialize for Interpolator
impl Serialize for Interpolator
impl StructuralPartialEq for Interpolator
Auto Trait Implementations§
impl Freeze for Interpolator
impl RefUnwindSafe for Interpolator
impl Send for Interpolator
impl Sync for Interpolator
impl Unpin for Interpolator
impl UnsafeUnpin for Interpolator
impl UnwindSafe for Interpolator
Blanket Implementations§
impl<T> Allocation for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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