feat: guard engine UI gateway access with safe prefix fallback (#1091)
This commit is contained in:
@ -244,6 +244,17 @@ impl Metrics {
|
||||
.fold((0, 0), |(a, b), (_, x, y)| (a + x, b + y))
|
||||
}
|
||||
|
||||
/// Fehler eines registrierten Modells seit Gateway-Start.
|
||||
pub fn model_errors(&self, model: &str) -> u64 {
|
||||
let m = self.lock();
|
||||
m.requests
|
||||
.iter()
|
||||
.filter(|((name, status), _)| name == model && *status >= 500)
|
||||
.map(|(_, count)| count)
|
||||
.sum::<u64>()
|
||||
+ m.start_failures.get(model).copied().unwrap_or(0)
|
||||
}
|
||||
|
||||
/// Ausgabe im Prometheus-Textformat.
|
||||
pub fn render(&self) -> String {
|
||||
let m = self.lock();
|
||||
|
||||
Reference in New Issue
Block a user