Mountain/IPC/StatusReporter/
mountain_get_performance_metrics.rs1
2use tauri::Manager;
6
7use crate::{
8 IPC::StatusReporter::{PerformanceMetrics::Struct as PerformanceMetrics, Reporter::Struct as Reporter},
9 dev_log,
10};
11
12#[tauri::command]
13pub async fn mountain_get_performance_metrics(app_handle:tauri::AppHandle) -> Result<PerformanceMetrics, String> {
14 dev_log!("lifecycle", "Tauri command: get_performance_metrics");
15
16 if let Some(reporter) = app_handle.try_state::<Reporter>() {
17 reporter.get_performance_metrics()
18 } else {
19 Err("StatusReporter not found in application state".to_string())
20 }
21}