From c204ca2c4a36ad0cd469573d9f3d38304496ac0c Mon Sep 17 00:00:00 2001 From: Herbert Wolverson Date: Thu, 18 Jul 2024 12:12:43 -0500 Subject: [PATCH] Sort IP protocols and countries by DOWNLOAD not upload. Oops. --- .../flow_data/flow_analysis/finished_flows.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/rust/lqosd/src/throughput_tracker/flow_data/flow_analysis/finished_flows.rs b/src/rust/lqosd/src/throughput_tracker/flow_data/flow_analysis/finished_flows.rs index d0e55e6b..d25aef61 100644 --- a/src/rust/lqosd/src/throughput_tracker/flow_data/flow_analysis/finished_flows.rs +++ b/src/rust/lqosd/src/throughput_tracker/flow_data/flow_analysis/finished_flows.rs @@ -140,7 +140,7 @@ impl TimeBuffer { country_summary.push((last_country, total_bytes, rtt)); // Sort by bytes downloaded descending - country_summary.sort_by(|a, b| b.1.up.cmp(&a.1.up)); + country_summary.sort_by(|a, b| b.1.down.cmp(&a.1.down)); country_summary } @@ -231,7 +231,7 @@ impl TimeBuffer { }); let mut results = results.into_iter().collect::)>>(); - results.sort_by(|a, b| b.1.up.cmp(&a.1.up)); + results.sort_by(|a, b| b.1.down.cmp(&a.1.down)); // Keep only the top 10 results.truncate(10); results