基于遥测数据简单的健康评估
(&self)
| 57 | impl DeviceTelemetry { |
| 58 | /// 基于遥测数据简单的健康评估 |
| 59 | pub fn assess_health(&self) -> DeviceHealthStatus { |
| 60 | if let Some(t) = self.temperature_c { |
| 61 | if t > 85.0 { |
| 62 | return DeviceHealthStatus::Critical(HealthIssue::Overheating); |
| 63 | } else if t > 75.0 { |
| 64 | return DeviceHealthStatus::Warning(HealthIssue::Overheating); |
| 65 | } |
| 66 | } |
| 67 | |
| 68 | if self.transmission_errors > 100 { |
| 69 | return DeviceHealthStatus::Warning(HealthIssue::HighPacketLoss); |
| 70 | } |
| 71 | |
| 72 | DeviceHealthStatus::Healthy |
| 73 | } |
| 74 | } |
nothing calls this directly
no outgoing calls
no test coverage detected