pub struct TrendsConfig {
pub enabled: bool,
pub bucket_size_ms: u64,
pub retention_hours: u32,
pub max_signals_per_bucket: usize,
pub anomaly_check_interval_ms: u64,
pub anomaly_risk: HashMap<AnomalyType, u32>,
pub max_entities: usize,
pub max_recent_signals: usize,
pub max_anomalies: usize,
}Expand description
Configuration for the trends subsystem.
Fields§
§enabled: boolWhether trends tracking is enabled
bucket_size_ms: u64Size of each time bucket in milliseconds (default: 60000 = 1 minute)
retention_hours: u32How long to retain data in hours (default: 24)
max_signals_per_bucket: usizeMaximum signals per bucket (default: 10000)
anomaly_check_interval_ms: u64Anomaly detection check interval in milliseconds (default: 60000)
anomaly_risk: HashMap<AnomalyType, u32>Risk scores to apply for each anomaly type (0 = detection only)
max_entities: usizeMaximum entities to track (LRU eviction)
max_recent_signals: usizeMaximum recent signals to cache per entity
max_anomalies: usizeMaximum anomalies to retain
Implementations§
Source§impl TrendsConfig
impl TrendsConfig
Sourcepub fn get_anomaly_risk(&self, anomaly_type: &AnomalyType) -> u32
pub fn get_anomaly_risk(&self, anomaly_type: &AnomalyType) -> u32
Get the risk score for an anomaly type.
Sourcepub fn bucket_count(&self) -> usize
pub fn bucket_count(&self) -> usize
Calculate bucket count based on retention.
Trait Implementations§
Source§impl Clone for TrendsConfig
impl Clone for TrendsConfig
Source§fn clone(&self) -> TrendsConfig
fn clone(&self) -> TrendsConfig
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 TrendsConfig
impl Debug for TrendsConfig
Source§impl Default for TrendsConfig
impl Default for TrendsConfig
Source§impl<'de> Deserialize<'de> for TrendsConfig
impl<'de> Deserialize<'de> for TrendsConfig
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 TrendsConfig
impl RefUnwindSafe for TrendsConfig
impl Send for TrendsConfig
impl Sync for TrendsConfig
impl Unpin for TrendsConfig
impl UnsafeUnpin for TrendsConfig
impl UnwindSafe for TrendsConfig
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
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