use super::{Duration, HashMap};
#[derive(Debug, Clone)]
pub struct TestingConfig {
pub enable_parallel: bool,
pub max_concurrent_tests: usize,
pub test_timeout: Duration,
pub performance_tolerance: f64,
pub significance_level: f64,
pub data_retention: Duration,
pub detailed_logging: bool,
pub stress_test_sizes: Vec<usize>,
}
impl Default for TestingConfig {
fn default() -> Self {
Self {
enable_parallel: true,
max_concurrent_tests: 8,
test_timeout: Duration::from_secs(300),
performance_tolerance: 0.05,
significance_level: 0.05,
data_retention: Duration::from_secs(30 * 24 * 3600),
detailed_logging: true,
stress_test_sizes: vec![100, 500, 1000, 2000, 5000],
}
}
}
#[derive(Debug, Clone)]
pub struct AlertThresholds {
pub degradation_threshold: f64,
pub significance_level: f64,
pub min_sample_size: usize,
pub cooldown_period: Duration,
}
impl Default for AlertThresholds {
fn default() -> Self {
Self {
degradation_threshold: 0.1,
significance_level: 0.05,
min_sample_size: 10,
cooldown_period: Duration::from_secs(3600),
}
}
}
#[derive(Debug, Clone)]
pub struct RetentionPolicy {
pub retention_period: Duration,
pub cleanup_frequency: Duration,
pub archive_policy: Option<ArchivePolicy>,
}
#[derive(Debug, Clone)]
pub struct ArchivePolicy {
pub archive_location: String,
pub compression: bool,
pub format: ArchiveFormat,
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum ArchiveFormat {
JSON,
Binary,
Compressed,
Custom(String),
}
#[derive(Debug, Clone)]
pub struct StressResourceConstraints {
pub max_memory: Option<usize>,
pub max_cpu: Option<f64>,
pub max_time: Option<Duration>,
pub max_concurrent: Option<usize>,
}
#[derive(Debug, Clone)]
pub struct PlatformConfig {
pub platform_id: String,
pub connection_params: HashMap<String, String>,
pub auth_settings: Option<AuthSettings>,
pub platform_options: HashMap<String, String>,
}
#[derive(Debug, Clone)]
pub struct AuthSettings {
pub auth_type: AuthType,
pub credentials: HashMap<String, String>,
pub token_expiry: Option<Duration>,
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum AuthType {
ApiKey,
OAuth,
Certificate,
Custom(String),
}