Remove all unused code and fix build warnings

- Remove unused struct fields: tier, config_name, last_collection_time
- Remove unused structs: PerformanceMetrics, PerfMonitor
- Remove unused methods: get_performance_metrics, get_collector_names, get_stats
- Remove unused utility functions and system helpers
- Remove unused config fields from CPU and Memory collectors
- Keep config fields that are actually used (DiskCollector, etc.)
- Remove unused proxy_pass_url variable and assignments
- Fix duplicate hostname variable declaration
- Achieve zero build warnings without functionality changes
This commit is contained in:
2025-10-20 20:20:47 +02:00
parent 049ac53629
commit eb268922bd
12 changed files with 4 additions and 179 deletions

View File

@@ -237,21 +237,6 @@ impl MetricCollectionManager {
Ok(all_metrics)
}
/// Get names of all registered collectors
pub fn get_collector_names(&self) -> Vec<String> {
self.collectors
.iter()
.map(|c| c.name().to_string())
.collect()
}
/// Get collector statistics
pub fn get_stats(&self) -> HashMap<String, bool> {
self.collectors
.iter()
.map(|c| (c.name().to_string(), true)) // All collectors are enabled
.collect()
}
/// Get all cached metrics from the cache manager
pub async fn get_all_cached_metrics(&self) -> Result<Vec<Metric>> {
@@ -263,20 +248,4 @@ impl MetricCollectionManager {
Ok(cached_metrics)
}
/// Determine which collector handles a specific metric
fn get_collector_for_metric(&self, metric_name: &str) -> String {
if metric_name.starts_with("cpu_") {
"cpu".to_string()
} else if metric_name.starts_with("memory_") {
"memory".to_string()
} else if metric_name.starts_with("disk_") {
"disk".to_string()
} else if metric_name.starts_with("service_") {
"systemd".to_string()
} else if metric_name.starts_with("backup_") {
"backup".to_string()
} else {
"unknown".to_string()
}
}
}