Centralize lifecycle state updates and fix systemd running status (#2567)

This commit is contained in:
houseme
2026-04-17 11:20:11 +08:00
committed by GitHub
parent 6b4172998b
commit 478720d2ee
28 changed files with 230 additions and 213 deletions
+4 -5
View File
@@ -170,11 +170,10 @@ impl MetricsSnapshot {
}
pub fn avg_wait_time(&self) -> Duration {
if self.slow_path_success == 0 {
Duration::ZERO
} else {
Duration::from_nanos(self.total_wait_time_ns / self.slow_path_success)
}
self.total_wait_time_ns
.checked_div(self.slow_path_success)
.map(Duration::from_nanos)
.unwrap_or(Duration::ZERO)
}
pub fn max_wait_time(&self) -> Duration {