Skip to content

Commit 09ef712

Browse files
authored
Fix flush thread waiting time metric when we disable disk index (#3989)
fix flush thread waiting time metric when we disable disk index Co-authored-by: HaoranYi <[email protected]>
1 parent a2fb9d1 commit 09ef712

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

accounts-db/src/bucket_map_holder.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,9 +319,14 @@ impl<T: IndexValue, U: DiskIndexValue + From<T> + Into<T>> BucketMapHolder<T, U>
319319
let mut throttling_wait_ms = None;
320320
loop {
321321
if !flush {
322+
let mut m = Measure::start("wait");
322323
self.wait_dirty_or_aged.wait_timeout(Duration::from_millis(
323324
self.stats.remaining_until_next_interval(),
324325
));
326+
m.stop();
327+
self.stats
328+
.bg_waiting_us
329+
.fetch_add(m.as_us(), Ordering::Relaxed);
325330
} else if self.should_thread_sleep() || throttling_wait_ms.is_some() {
326331
let mut wait = std::cmp::min(
327332
self.age_timer

0 commit comments

Comments
 (0)