From dee2bcca44b63906d0d9361735e6214e44f86325 Mon Sep 17 00:00:00 2001 From: Joonas Koivunen Date: Wed, 4 Oct 2023 13:01:07 +0300 Subject: [PATCH] fix: time the reconstruction, not future creation (#5459) `pageserver_getpage_reconstruct_seconds` histogram had been only recording the time it takes to create a future, not await on it. Since: https://github.com/neondatabase/neon/commit/eb0a698adcb94ece00c21a7689145b47956c0588. --- pageserver/src/tenant/timeline.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pageserver/src/tenant/timeline.rs b/pageserver/src/tenant/timeline.rs index f8566f1a51..008b0195ff 100644 --- a/pageserver/src/tenant/timeline.rs +++ b/pageserver/src/tenant/timeline.rs @@ -501,9 +501,9 @@ impl Timeline { .await?; timer.stop_and_record(); - let res = RECONSTRUCT_TIME - .observe_closure_duration(|| self.reconstruct_value(key, lsn, reconstruct_state)) - .await; + let timer = RECONSTRUCT_TIME.start_timer(); + let res = self.reconstruct_value(key, lsn, reconstruct_state).await; + timer.stop_and_record(); if cfg!(feature = "testing") && res.is_err() { // it can only be walredo issue