summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStuart Stock <stuart@int08h.com>2020-06-20 11:26:09 -0700
committerStuart Stock <stuart@int08h.com>2020-06-20 11:26:09 -0700
commitcac90983711616fc49ce0408db3c12f4b90aa0b9 (patch)
tree38eb2018c78f64a4295cc51010859c382c781840
parentdd5e3d735dd5b0e1208e6ecfddf9673aa7b4c9a9 (diff)
downloadroughenough-cac90983711616fc49ce0408db3c12f4b90aa0b9.zip
stats: sort status update in actual descending order
-rw-r--r--src/server.rs3
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!(