diff options
author | Stuart Stock <stuart@int08h.com> | 2020-06-20 11:26:09 -0700 |
---|---|---|
committer | Stuart Stock <stuart@int08h.com> | 2020-06-20 11:26:09 -0700 |
commit | cac90983711616fc49ce0408db3c12f4b90aa0b9 (patch) | |
tree | 38eb2018c78f64a4295cc51010859c382c781840 | |
parent | dd5e3d735dd5b0e1208e6ecfddf9673aa7b4c9a9 (diff) | |
download | roughenough-cac90983711616fc49ce0408db3c12f4b90aa0b9.zip |
stats: sort status update in actual descending order
-rw-r--r-- | src/server.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/server.rs b/src/server.rs index 438311d..5af60c0 100644 --- a/src/server.rs +++ b/src/server.rs @@ -390,7 +390,8 @@ impl Server { fn handle_status_update(&mut self) { let mut vec: Vec<(&IpAddr, &ClientStatEntry)> = self.stats.iter().collect(); - vec.sort_by(|lhs, rhs| lhs.1.valid_requests.cmp(&rhs.1.valid_requests)); + // sort in descending order + vec.sort_by(|lhs, rhs| rhs.1.valid_requests.cmp(&lhs.1.valid_requests)); for (addr, counts) in vec { info!( |