use std::time::Duration;
#[derive(Debug, Clone, Default)]
pub struct MonitorConfig {
pub query_timeout: Option<Duration>,
pub slow_query_threshold: Option<Duration>,
pub monitoring_enabled: bool,
}
impl MonitorConfig {
pub fn new() -> Self {
Self::default()
}
pub fn with_query_timeout(mut self, timeout: Duration) -> Self {
self.query_timeout = Some(timeout);
self
}
pub fn with_slow_query_threshold(mut self, threshold: Duration) -> Self {
self.slow_query_threshold = Some(threshold);
self
}
pub fn enable_monitoring(mut self) -> Self {
self.monitoring_enabled = true;
self
}
pub fn disable_monitoring(mut self) -> Self {
self.monitoring_enabled = false;
self
}
}