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:
@ -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
|
||||
|
||||
Reference in New Issue
Block a user