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:
eb0a698adc.
This commit is contained in:
Joonas Koivunen
2023-10-04 13:01:07 +03:00
committed by GitHub
parent db8ff9d64b
commit dee2bcca44

View File

@@ -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