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