pub struct ColumnTemperature {
pub name: String,
pub temperature: f64,
pub window_updates: u64,
pub total_updates: u64,
pub last_update_us: u64,
}Expand description
Temperature tracking for a single column using Exponential Moving Average.
Temperature is computed as: temp_new = α × temp_current + (1-α) × temp_old where α = 0.1 (decay factor) and temp_current = updates_in_window / total_updates
Fields§
§name: StringColumn name
temperature: f64Current temperature (0.0 = cold, 1.0 = hot)
window_updates: u64Updates in current window
total_updates: u64Total updates since last decay
last_update_us: u64Last update timestamp (micros)
Implementations§
Source§impl ColumnTemperature
impl ColumnTemperature
Sourcepub fn record_update(&mut self)
pub fn record_update(&mut self)
Record an update to this column
Sourcepub fn update_ema(&mut self, total_window_updates: u64)
pub fn update_ema(&mut self, total_window_updates: u64)
Update temperature using EMA when window completes
α = 0.1 (decay factor) temp_new = α × temp_current + (1-α) × temp_old
Trait Implementations§
Source§impl Clone for ColumnTemperature
impl Clone for ColumnTemperature
Source§fn clone(&self) -> ColumnTemperature
fn clone(&self) -> ColumnTemperature
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ColumnTemperature
impl Debug for ColumnTemperature
Source§impl<'de> Deserialize<'de> for ColumnTemperature
impl<'de> Deserialize<'de> for ColumnTemperature
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ColumnTemperature
impl RefUnwindSafe for ColumnTemperature
impl Send for ColumnTemperature
impl Sync for ColumnTemperature
impl Unpin for ColumnTemperature
impl UnwindSafe for ColumnTemperature
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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 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>
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