quantrs2_anneal/advanced_testing_framework/
config.rs1use super::{Duration, HashMap};
4
5#[derive(Debug, Clone)]
7pub struct TestingConfig {
8 pub enable_parallel: bool,
10 pub max_concurrent_tests: usize,
12 pub test_timeout: Duration,
14 pub performance_tolerance: f64,
16 pub significance_level: f64,
18 pub data_retention: Duration,
20 pub detailed_logging: bool,
22 pub stress_test_sizes: Vec<usize>,
24}
25
26impl Default for TestingConfig {
27 fn default() -> Self {
28 Self {
29 enable_parallel: true,
30 max_concurrent_tests: 8,
31 test_timeout: Duration::from_secs(300),
32 performance_tolerance: 0.05,
33 significance_level: 0.05,
34 data_retention: Duration::from_secs(30 * 24 * 3600),
35 detailed_logging: true,
36 stress_test_sizes: vec![100, 500, 1000, 2000, 5000],
37 }
38 }
39}
40
41#[derive(Debug, Clone)]
43pub struct AlertThresholds {
44 pub degradation_threshold: f64,
46 pub significance_level: f64,
48 pub min_sample_size: usize,
50 pub cooldown_period: Duration,
52}
53
54impl Default for AlertThresholds {
55 fn default() -> Self {
56 Self {
57 degradation_threshold: 0.1,
58 significance_level: 0.05,
59 min_sample_size: 10,
60 cooldown_period: Duration::from_secs(3600),
61 }
62 }
63}
64
65#[derive(Debug, Clone)]
67pub struct RetentionPolicy {
68 pub retention_period: Duration,
70 pub cleanup_frequency: Duration,
72 pub archive_policy: Option<ArchivePolicy>,
74}
75
76#[derive(Debug, Clone)]
78pub struct ArchivePolicy {
79 pub archive_location: String,
81 pub compression: bool,
83 pub format: ArchiveFormat,
85}
86
87#[derive(Debug, Clone, PartialEq, Eq)]
89pub enum ArchiveFormat {
90 JSON,
92 Binary,
94 Compressed,
96 Custom(String),
98}
99
100#[derive(Debug, Clone)]
102pub struct StressResourceConstraints {
103 pub max_memory: Option<usize>,
105 pub max_cpu: Option<f64>,
107 pub max_time: Option<Duration>,
109 pub max_concurrent: Option<usize>,
111}
112
113#[derive(Debug, Clone)]
115pub struct PlatformConfig {
116 pub platform_id: String,
118 pub connection_params: HashMap<String, String>,
120 pub auth_settings: Option<AuthSettings>,
122 pub platform_options: HashMap<String, String>,
124}
125
126#[derive(Debug, Clone)]
128pub struct AuthSettings {
129 pub auth_type: AuthType,
131 pub credentials: HashMap<String, String>,
133 pub token_expiry: Option<Duration>,
135}
136
137#[derive(Debug, Clone, PartialEq, Eq)]
139pub enum AuthType {
140 ApiKey,
142 OAuth,
144 Certificate,
146 Custom(String),
148}