style: Clippy-Hinweise in health.rs (#1197)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GmHhg7qE8FdhchzsBrwgjZ
This commit is contained in:
@ -186,23 +186,23 @@ pub fn bewerte(e: &Eingabe) -> Gesundheit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if let Some(h) = &e.host {
|
if let Some(h) = &e.host {
|
||||||
if let Some(ram) = h.ram {
|
if let Some(s) = h
|
||||||
if let Some(s) = anteil(ram.belegt_mb, ram.gesamt_mb).and_then(stufe) {
|
.ram
|
||||||
gruende.push(grund(
|
.and_then(|ram| anteil(ram.belegt_mb, ram.gesamt_mb))
|
||||||
s,
|
.and_then(stufe)
|
||||||
"Arbeitsspeicher",
|
{
|
||||||
format!("Über {} Prozent belegt", schwelle(s)),
|
gruende.push(grund(
|
||||||
));
|
s,
|
||||||
}
|
"Arbeitsspeicher",
|
||||||
|
format!("Über {} Prozent belegt", schwelle(s)),
|
||||||
|
));
|
||||||
}
|
}
|
||||||
if let Some(cpu) = h.cpu_prozent {
|
if h.cpu_prozent.is_some_and(|cpu| cpu >= KNAPP_PROZENT) {
|
||||||
if cpu >= KNAPP_PROZENT {
|
gruende.push(grund(
|
||||||
gruende.push(grund(
|
Schwere::Eingeschraenkt,
|
||||||
Schwere::Eingeschraenkt,
|
"CPU",
|
||||||
"CPU",
|
format!("Auslastung über {} Prozent", KNAPP_PROZENT as u32),
|
||||||
format!("Auslastung über {} Prozent", KNAPP_PROZENT as u32),
|
));
|
||||||
));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if let Some(f) = &h.fehler {
|
if let Some(f) = &h.fehler {
|
||||||
gruende.push(grund(
|
gruende.push(grund(
|
||||||
@ -223,14 +223,12 @@ pub fn bewerte(e: &Eingabe) -> Gesundheit {
|
|||||||
),
|
),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
if let Some(w) = e.aelteste_wartezeit_s {
|
if let Some(w) = e.aelteste_wartezeit_s.filter(|w| *w >= WARTEZEIT_WARNUNG_S) {
|
||||||
if w >= WARTEZEIT_WARNUNG_S {
|
gruende.push(grund(
|
||||||
gruende.push(grund(
|
Schwere::Eingeschraenkt,
|
||||||
Schwere::Eingeschraenkt,
|
"Warteschlange",
|
||||||
"Warteschlange",
|
format!("Älteste Anfrage wartet seit {w} Sekunden"),
|
||||||
format!("Älteste Anfrage wartet seit {w} Sekunden"),
|
));
|
||||||
));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Veraltete Messwerte werden nie als „in Ordnung“ gewertet.
|
// Veraltete Messwerte werden nie als „in Ordnung“ gewertet.
|
||||||
@ -247,7 +245,7 @@ pub fn bewerte(e: &Eingabe) -> Gesundheit {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
gruende.sort_by(|a, b| b.schwere.cmp(&a.schwere));
|
gruende.sort_by_key(|g| std::cmp::Reverse(g.schwere));
|
||||||
let schwerste = gruende.first().map(|g| g.schwere);
|
let schwerste = gruende.first().map(|g| g.schwere);
|
||||||
let noch_nichts_gemessen = e.gpu_alter_s.is_none() && e.host_alter_s.is_none();
|
let noch_nichts_gemessen = e.gpu_alter_s.is_none() && e.host_alter_s.is_none();
|
||||||
let zustand = match schwerste {
|
let zustand = match schwerste {
|
||||||
|
|||||||
Reference in New Issue
Block a user