Skip to main content

entrenar/monitor/gpu/alert/
thresholds.rs

1//! Andon threshold configuration.
2
3use serde::{Deserialize, Serialize};
4
5/// Andon thresholds for GPU alerts
6#[derive(Debug, Clone, Serialize, Deserialize)]
7pub struct AndonThresholds {
8    /// Temperature warning threshold in Celsius
9    pub thermal_warning: u32,
10    /// Temperature critical threshold in Celsius
11    pub thermal_critical: u32,
12    /// Memory usage warning threshold (0-100%)
13    pub memory_warning: u32,
14    /// Memory usage critical threshold (0-100%)
15    pub memory_critical: u32,
16    /// Power usage warning threshold (0-100% of limit)
17    pub power_warning: u32,
18    /// Idle duration threshold in seconds
19    pub idle_threshold_secs: u32,
20}
21
22impl Default for AndonThresholds {
23    fn default() -> Self {
24        Self {
25            thermal_warning: 80,
26            thermal_critical: 90,
27            memory_warning: 90,
28            memory_critical: 95,
29            power_warning: 95,
30            idle_threshold_secs: 30,
31        }
32    }
33}