summaryrefslogtreecommitdiff
path: root/Echolot/Stats.pm
diff options
context:
space:
mode:
authorPeter Palfrader <peter@palfrader.org>2002-07-17 18:53:15 +0000
committerPeter Palfrader <peter@palfrader.org>2002-07-17 18:53:15 +0000
commitd43f43f5c9453ebeaaab8704e5b1b8a1f1b67114 (patch)
tree5a1a71e06c816589b94fa85c3d3789742525bfde /Echolot/Stats.pm
parent4556e8641919997ee102d066dd173a15da3bdff5 (diff)
Stats can be sorted by latency rather than nick
Diffstat (limited to 'Echolot/Stats.pm')
-rw-r--r--Echolot/Stats.pm6
1 files changed, 5 insertions, 1 deletions
diff --git a/Echolot/Stats.pm b/Echolot/Stats.pm
index 3efc5e5..402cbd9 100644
--- a/Echolot/Stats.pm
+++ b/Echolot/Stats.pm
@@ -1,7 +1,7 @@
package Echolot::Stats;
# (c) 2002 Peter Palfrader <peter@palfrader.org>
-# $Id: Stats.pm,v 1.21 2002/07/16 02:48:57 weasel Exp $
+# $Id: Stats.pm,v 1.22 2002/07/17 18:53:15 weasel Exp $
#
=pod
@@ -451,13 +451,17 @@ sub build_rems($) {
'address' => $addr,
'showit' => $remailer->{'showit'}
};
+ $rem->{'latency'} = $rem->{'stats'}->{'avr_latency'}; # for sorting purposes only
+ $rem->{'latency'} = 9999 unless defined $rem->{'latency'};
$rems{$addr} = $rem if (defined $rem->{'stats'} && defined $rem->{'nick'} && defined $rem->{'address'} && defined $rem->{'caps'} );
};
+ my $sort_by_latency = Echolot::Config::get()->{'stats_sort_by_latency'};
my @rems =
sort {
- ($a->{'stats'}->{'avr_reliability'} <=> $b->{'stats'}->{'avr_reliability'}) ||
+ (($a->{'latency'} <=> $b->{'latency'}) * $sort_by_latency) ||
($a->{'nick'} cmp $b->{'nick'})
} map { $rems{$_} } keys %rems;