From d43f43f5c9453ebeaaab8704e5b1b8a1f1b67114 Mon Sep 17 00:00:00 2001 From: Peter Palfrader Date: Wed, 17 Jul 2002 18:53:15 +0000 Subject: Stats can be sorted by latency rather than nick --- Echolot/Stats.pm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'Echolot/Stats.pm') 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 -# $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; -- cgit v1.2.3