feat(api): Zeitstempel und Host-Werte in den Metriken (#1197, DASH-R1 AP4)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GmHhg7qE8FdhchzsBrwgjZ
This commit is contained in:
2026-11-22 10:41:00 +01:00
parent c432fc2b86
commit b355d0296f
2 changed files with 62 additions and 1 deletions

View File

@ -196,6 +196,8 @@ pub struct Runtime {
pub metrics: Arc<Metrics>,
shared: Arc<Shared>,
health: tokio::sync::Mutex<HealthCache>,
/// Merkt den CPU-Zählerstand zwischen zwei Messungen.
host_leser: std::sync::Mutex<crate::hostmetrics::HostLeser>,
}
#[derive(Default)]
@ -255,6 +257,7 @@ impl Runtime {
metrics,
shared,
health: tokio::sync::Mutex::new(HealthCache::default()),
host_leser: std::sync::Mutex::new(crate::hostmetrics::HostLeser::new()),
}
}
@ -599,6 +602,12 @@ impl Runtime {
self.metrics.set_instances(samples);
self.metrics.set_gpus(gpus);
self.metrics.set_gpu_status(gpu_status);
let host = self
.host_leser
.lock()
.unwrap_or_else(|e| e.into_inner())
.lesen();
self.metrics.set_host(host);
}
/// Lehnt alle Wartenden ab und beendet alle Instanzen, auch solche, die