Skip to content

Commit 55664f1

Browse files
committed
Make frequency calculation more clear
1 parent 7f237b7 commit 55664f1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/task/blocking.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,10 @@ lazy_static! {
6060

6161
fn calculate_dispatch_frequency() {
6262
// Calculate current message processing rate here
63-
let previous_freq = FREQUENCY.fetch_sub(1, Ordering::Relaxed);
63+
let current_freq = FREQUENCY.fetch_sub(1, Ordering::Relaxed);
6464
let avr_freq = AVR_FREQUENCY.load(Ordering::Relaxed);
6565
let current_pool_size = CURRENT_POOL_SIZE.load(Ordering::Relaxed);
66-
let frequency = (avr_freq as f64 + previous_freq as f64 / current_pool_size as f64) as u64;
66+
let frequency = (avr_freq as f64 + current_freq as f64 / current_pool_size as f64) as u64;
6767
AVR_FREQUENCY.store(frequency, Ordering::Relaxed);
6868

6969
// Adapt the thread count of pool

0 commit comments

Comments
 (0)