pub struct AnomalyDetectionConfig {
pub enabled: bool,
pub window_size: usize,
pub sigma_threshold: f64,
pub check_cost: bool,
pub check_tokens: bool,
pub check_velocity: bool,
pub check_latency: bool,
}Expand description
Anomaly detection configuration.
When enabled, the proxy tracks per-tenant moving averages and detects statistical anomalies using a sliding window and sigma thresholds.
§Example (YAML)
anomaly_detection:
enabled: true
window_size: 100
sigma_threshold: 3.0
check_cost: true
check_tokens: true
check_velocity: true
check_latency: trueFields§
§enabled: boolEnable anomaly detection.
window_size: usizeNumber of recent observations in the sliding window.
sigma_threshold: f64Sigma multiplier for anomaly threshold (default: 3.0).
check_cost: boolCheck for cost anomalies.
check_tokens: boolCheck for token usage anomalies.
check_velocity: boolCheck for request velocity anomalies.
check_latency: boolCheck for latency anomalies.
Trait Implementations§
Source§impl Clone for AnomalyDetectionConfig
impl Clone for AnomalyDetectionConfig
Source§fn clone(&self) -> AnomalyDetectionConfig
fn clone(&self) -> AnomalyDetectionConfig
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 AnomalyDetectionConfig
impl Debug for AnomalyDetectionConfig
Source§impl Default for AnomalyDetectionConfig
impl Default for AnomalyDetectionConfig
Source§impl<'de> Deserialize<'de> for AnomalyDetectionConfig
impl<'de> Deserialize<'de> for AnomalyDetectionConfig
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 AnomalyDetectionConfig
impl RefUnwindSafe for AnomalyDetectionConfig
impl Send for AnomalyDetectionConfig
impl Sync for AnomalyDetectionConfig
impl Unpin for AnomalyDetectionConfig
impl UnsafeUnpin for AnomalyDetectionConfig
impl UnwindSafe for AnomalyDetectionConfig
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