quantrs2_device/mapping_scirs2/
analytics.rs1use super::*;
4
5#[derive(Debug, Clone, Serialize, Deserialize)]
7pub struct MappingAnalyticsConfig {
8 pub enable_analytics: bool,
10 pub tracking_level: AnalysisDepth,
12 pub metrics_to_track: Vec<TrackingMetric>,
14 pub anomaly_detection: AnomalyDetectionConfig,
16 pub alerting: AlertConfig,
18 pub reporting: ReportingConfig,
20}
21
22#[derive(Debug, Clone, Serialize, Deserialize)]
24pub struct AnomalyDetectionConfig {
25 pub enable_detection: bool,
27 pub detection_method: AnomalyDetectionMethod,
29 pub threshold: f64,
31 pub window_size: usize,
33}
34
35#[derive(Debug, Clone, Serialize, Deserialize)]
37pub struct AlertConfig {
38 pub enable_alerts: bool,
40 pub severity_threshold: f64,
42 pub notification_methods: Vec<NotificationMethod>,
44 pub cooldown_period: Duration,
46}
47
48#[derive(Debug, Clone, Serialize, Deserialize)]
50pub struct ReportingConfig {
51 pub enable_reporting: bool,
53 pub report_frequency: Duration,
55 pub report_format: ReportFormat,
57 pub content_config: ReportContentConfig,
59}
60
61#[derive(Debug, Clone, Serialize, Deserialize)]
63pub struct ReportContentConfig {
64 pub include_performance_metrics: bool,
66 pub include_trend_analysis: bool,
68 pub include_recommendations: bool,
70 pub include_visualizations: bool,
72}
73
74#[derive(Debug, Clone, Serialize, Deserialize)]
76pub struct RealtimeAnalyticsResult {
77 pub current_metrics: HashMap<String, f64>,
79 pub performance_trends: HashMap<String, Vec<(SystemTime, f64)>>,
81 pub anomalies: Vec<DetectedAnomaly>,
83 pub resource_utilization: ResourceUtilization,
85 pub quality_assessments: Vec<QualityAssessment>,
87}
88
89#[derive(Debug, Clone, Serialize, Deserialize)]
91pub struct DetectedAnomaly {
92 pub timestamp: SystemTime,
94 pub anomaly_type: String,
96 pub severity: f64,
98 pub description: String,
100 pub affected_metrics: Vec<String>,
102 pub recommended_actions: Vec<String>,
104}
105
106#[derive(Debug, Clone, Serialize, Deserialize)]
108pub struct ResourceUtilization {
109 pub cpu_usage: f64,
111 pub memory_usage: f64,
113 pub disk_io: f64,
115 pub network_usage: f64,
117 pub gpu_usage: Option<f64>,
119}
120
121#[derive(Debug, Clone, Serialize, Deserialize)]
123pub struct QualityAssessment {
124 pub timestamp: SystemTime,
126 pub metric_type: QualityMetricType,
128 pub score: f64,
130 pub confidence: f64,
132 pub baseline_comparison: f64,
134}
135
136#[derive(Debug, Clone, Serialize, Deserialize)]
138pub struct OptimizationRecommendations {
139 pub algorithm_recommendations: Vec<AlgorithmRecommendation>,
141 pub parameter_suggestions: Vec<ParameterSuggestion>,
143 pub hardware_optimizations: Vec<HardwareOptimization>,
145 pub improvement_predictions: HashMap<String, f64>,
147}
148
149#[derive(Debug, Clone, Serialize, Deserialize)]
151pub struct AlgorithmRecommendation {
152 pub algorithm: String,
154 pub confidence: f64,
156 pub expected_gain: f64,
158 pub reasoning: String,
160}
161
162#[derive(Debug, Clone, Serialize, Deserialize)]
164pub struct ParameterSuggestion {
165 pub parameter: String,
167 pub value_range: (f64, f64),
169 pub priority: SuggestionPriority,
171 pub impact: String,
173}
174
175#[derive(Debug, Clone, Serialize, Deserialize)]
177pub struct HardwareOptimization {
178 pub optimization_type: String,
180 pub target_component: String,
182 pub parameters: HashMap<String, f64>,
184 pub expected_benefit: f64,
186 pub complexity: String,
188}