mirror of
https://github.com/LibreQoE/LibreQoS.git
synced 2025-02-25 18:55:32 -06:00
Limit RTT tracking to flows that have achieved 1 Mbps or more.
This commit is contained in:
parent
dec1440b31
commit
7b6da8e32e
@ -99,6 +99,9 @@ pub unsafe extern "C" fn flowbee_handle_events(
|
|||||||
|
|
||||||
if let Ok(now) = time_since_boot() {
|
if let Ok(now) = time_since_boot() {
|
||||||
let since_boot = Duration::from(now);
|
let since_boot = Duration::from(now);
|
||||||
|
if incoming.rtt == 0 {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
let mut lock = FLOW_RTT.lock().unwrap();
|
let mut lock = FLOW_RTT.lock().unwrap();
|
||||||
if let Some(entry) = lock.get_mut(&incoming.key) {
|
if let Some(entry) = lock.get_mut(&incoming.key) {
|
||||||
entry.push(
|
entry.push(
|
||||||
|
@ -267,6 +267,8 @@ impl ThroughputTracker {
|
|||||||
rtts.sort();
|
rtts.sort();
|
||||||
let median = rtts[rtts.len() / 2];
|
let median = rtts[rtts.len() / 2];
|
||||||
if let Some(mut tracker) = self.raw_data.get_mut(&local_ip) {
|
if let Some(mut tracker) = self.raw_data.get_mut(&local_ip) {
|
||||||
|
// Only apply if the flow has achieved 1 Mbps or more
|
||||||
|
if tracker.bytes_per_second.0 + tracker.bytes_per_second.1 > 125000 {
|
||||||
// Shift left
|
// Shift left
|
||||||
for i in 1..60 {
|
for i in 1..60 {
|
||||||
tracker.recent_rtt_data[i] = tracker.recent_rtt_data[i - 1];
|
tracker.recent_rtt_data[i] = tracker.recent_rtt_data[i - 1];
|
||||||
@ -282,6 +284,7 @@ impl ThroughputTracker {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Key Expiration
|
// Key Expiration
|
||||||
if !expired_keys.is_empty() {
|
if !expired_keys.is_empty() {
|
||||||
|
Loading…
Reference in New Issue
Block a user