Skip to content

Commit

Permalink
fix flush thread waiting time metric when we disable disk index
Browse files Browse the repository at this point in the history
  • Loading branch information
HaoranYi committed Dec 6, 2024
1 parent 3c793d6 commit 58736d0
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions accounts-db/src/bucket_map_holder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -319,9 +319,14 @@ impl<T: IndexValue, U: DiskIndexValue + From<T> + Into<T>> BucketMapHolder<T, U>
let mut throttling_wait_ms = None;
loop {
if !flush {
let mut m = Measure::start("wait");
self.wait_dirty_or_aged.wait_timeout(Duration::from_millis(
self.stats.remaining_until_next_interval(),
));
m.stop();
self.stats
.bg_waiting_us
.fetch_add(m.as_us(), Ordering::Relaxed);
} else if self.should_thread_sleep() || throttling_wait_ms.is_some() {
let mut wait = std::cmp::min(
self.age_timer
Expand Down

0 comments on commit 58736d0

Please sign in to comment.