pub struct AnalyticsConfig {
pub enabled: bool,
pub max_latency_samples: usize,
pub max_recent_errors: usize,
pub throughput_window_secs: u64,
pub enable_endpoint_metrics: bool,
pub max_endpoints: usize,
pub enable_rate_limit_tracking: bool,
pub exclude_paths: Vec<String>,
pub include_query_params: bool,
pub sampling_rate: f64,
pub track_clients: bool,
pub max_rate_limit_clients: usize,
}Expand description
Configuration for the analytics module
Fields§
§enabled: boolEnable analytics collection
max_latency_samples: usizeMaximum number of latency samples to keep for percentile calculation
max_recent_errors: usizeMaximum number of recent errors to keep
throughput_window_secs: u64Time window for throughput calculation (in seconds)
enable_endpoint_metrics: boolEnable per-endpoint metrics
max_endpoints: usizeMaximum number of endpoints to track
enable_rate_limit_tracking: boolEnable rate limit tracking
exclude_paths: Vec<String>Paths to exclude from analytics
include_query_params: boolWhether to include query parameters in path tracking
sampling_rate: f64Sampling rate (0.0 to 1.0, 1.0 = 100% of requests)
track_clients: boolEnable client identification tracking
max_rate_limit_clients: usizeMaximum number of unique clients to track for rate limits
Implementations§
Source§impl AnalyticsConfig
impl AnalyticsConfig
Sourcepub fn builder() -> AnalyticsConfigBuilder
pub fn builder() -> AnalyticsConfigBuilder
Create a new configuration builder
Sourcepub fn development() -> Self
pub fn development() -> Self
Create configuration for development (verbose tracking)
Sourcepub fn production() -> Self
pub fn production() -> Self
Create configuration for production (optimized)
Sourcepub fn should_exclude(&self, path: &str) -> bool
pub fn should_exclude(&self, path: &str) -> bool
Check if a path should be excluded
Sourcepub fn should_sample(&self) -> bool
pub fn should_sample(&self) -> bool
Check if this request should be sampled
Trait Implementations§
Source§impl Clone for AnalyticsConfig
impl Clone for AnalyticsConfig
Source§fn clone(&self) -> AnalyticsConfig
fn clone(&self) -> AnalyticsConfig
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 AnalyticsConfig
impl Debug for AnalyticsConfig
Source§impl Default for AnalyticsConfig
impl Default for AnalyticsConfig
Source§impl<'de> Deserialize<'de> for AnalyticsConfig
impl<'de> Deserialize<'de> for AnalyticsConfig
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 AnalyticsConfig
impl RefUnwindSafe for AnalyticsConfig
impl Send for AnalyticsConfig
impl Sync for AnalyticsConfig
impl Unpin for AnalyticsConfig
impl UnwindSafe for AnalyticsConfig
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