port forward the drive-by fix to measure() from 2466a2f977

This commit is contained in:
Christian Schwarz
2025-02-05 15:11:30 +01:00
parent 6add559b92
commit 557b27e0be

View File

@@ -1319,12 +1319,12 @@ impl SmgrOpFlushInProgress {
{
let mut fut = std::pin::pin!(fut);
let now = Instant::now();
// Whenever observe_guard gets called, or dropped,
// it adds the time elapsed since its last call to metrics.
// Last call is tracked in `now`.
let mut observe_guard = scopeguard::guard(
|| {
let now = Instant::now();
let elapsed = now - self.base;
self.global_micros
.inc_by(u64::try_from(elapsed.as_micros()).unwrap());