This commit is contained in:
2026-05-16 17:57:54 +02:00
parent 1a2ec26f27
commit b2cefb7d66
55 changed files with 1654 additions and 334 deletions
+16
View File
@@ -23,6 +23,8 @@ use std::sync::atomic::{AtomicU64, Ordering};
use std::sync::Arc;
use std::time::{Duration, Instant};
use crate::metrics::{Metrics, MetricsSnapshot};
// ── Compteurs ────────────────────────────────────────────────────────────────
/// Compteurs atomiques du serveur HTTP.
@@ -99,6 +101,14 @@ impl HttpMetrics {
}
}
impl Metrics for HttpMetrics {
type Snapshot = HttpMetricsSnapshot;
fn snapshot(&self) -> HttpMetricsSnapshot {
self.snapshot()
}
}
// ── Snapshot ─────────────────────────────────────────────────────────────────
/// Lecture cohérente des compteurs à un instant T.
@@ -148,6 +158,12 @@ impl HttpMetricsSnapshot {
}
}
impl MetricsSnapshot for HttpMetricsSnapshot {
fn taken_at(&self) -> Instant {
self.taken_at
}
}
// ── Taux ─────────────────────────────────────────────────────────────────────
/// Taux moyens par seconde calculés entre deux snapshots.