summaryrefslogtreecommitdiffstats
path: root/src/api/stats
diff options
context:
space:
mode:
Diffstat (limited to 'src/api/stats')
-rw-r--r--src/api/stats/prometheus.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/api/stats/prometheus.rs b/src/api/stats/prometheus.rs
index 74c18e9..07a6cc8 100644
--- a/src/api/stats/prometheus.rs
+++ b/src/api/stats/prometheus.rs
@@ -7,6 +7,7 @@ use std::fmt::Write;
use tokio::time::Instant;
use super::StatsResponse;
+use crate::locks::MutexExt;
use crate::state::{AppState, Incidents, Liveness};
use crate::transport::traffic::{ByKind, Counter, PeerTraffic};
@@ -136,8 +137,7 @@ async fn peers(state: &AppState) -> Vec<Peer> {
.map(|rtt| rtt.as_secs_f64());
let throughput = state
.throughput
- .lock()
- .unwrap_or_else(|poisoned| poisoned.into_inner())
+ .lock_or_recover()
.get(&key)
.map(|estimate| estimate.bytes_per_sec);
let traffic = state.traffic.peer(&key).unwrap_or_default();