diff --git a/src/rust/lqos_sys/src/bpf/common/flows.h b/src/rust/lqos_sys/src/bpf/common/flows.h index b44d2d45..fcd2fbe0 100644 --- a/src/rust/lqos_sys/src/bpf/common/flows.h +++ b/src/rust/lqos_sys/src/bpf/common/flows.h @@ -10,7 +10,7 @@ #define SECOND_IN_NANOS 1000000000 #define TWO_SECONDS_IN_NANOS 2000000000 -#define MS_IN_NANOS_T10 1000 +#define MS_IN_NANOS_T10 10000 #define HALF_MBPS_IN_BYTES_PER_SECOND 62500 #define RTT_RING_SIZE 4 //#define TIMESTAMP_INTERVAL_NANOS 10000000 diff --git a/src/rust/lqosd/src/throughput_tracker/mod.rs b/src/rust/lqosd/src/throughput_tracker/mod.rs index a3b2405c..35eb32b5 100644 --- a/src/rust/lqosd/src/throughput_tracker/mod.rs +++ b/src/rust/lqosd/src/throughput_tracker/mod.rs @@ -413,9 +413,9 @@ pub fn rtt_histogram() -> BusResponse { .collect(); let samples = valid_samples.len() as u32; if samples > 0 { - let median = valid_samples[valid_samples.len() / 2] as f32 / 100.0; + let median = valid_samples[valid_samples.len() / 2] as f32 / 10.0; let median = f32::min(200.0, median); - let column = (median / 10.0) as usize; + let column = median as usize; result[usize::min(column, 19)] += 1; } } diff --git a/src/rust/lqosd/src/throughput_tracker/throughput_entry.rs b/src/rust/lqosd/src/throughput_tracker/throughput_entry.rs index 72407beb..8b42b819 100644 --- a/src/rust/lqosd/src/throughput_tracker/throughput_entry.rs +++ b/src/rust/lqosd/src/throughput_tracker/throughput_entry.rs @@ -34,7 +34,7 @@ impl ThroughputEntry { .recent_rtt_data .iter() .filter(|n| **n != 0) - .map(|n| *n as f32) + .map(|n| *n as f32 / 10.0) .collect(); if shifted.len() < 5 { return None;