diff options
author | Peter Palfrader <peter@palfrader.org> | 2002-07-17 18:53:15 +0000 |
---|---|---|
committer | Peter Palfrader <peter@palfrader.org> | 2002-07-17 18:53:15 +0000 |
commit | d43f43f5c9453ebeaaab8704e5b1b8a1f1b67114 (patch) | |
tree | 5a1a71e06c816589b94fa85c3d3789742525bfde /Echolot | |
parent | 4556e8641919997ee102d066dd173a15da3bdff5 (diff) |
Stats can be sorted by latency rather than nick
Diffstat (limited to 'Echolot')
-rw-r--r-- | Echolot/Config.pm | 3 | ||||
-rw-r--r-- | Echolot/Stats.pm | 6 |
2 files changed, 7 insertions, 2 deletions
diff --git a/Echolot/Config.pm b/Echolot/Config.pm index e01461e..98474a3 100644 --- a/Echolot/Config.pm +++ b/Echolot/Config.pm @@ -1,7 +1,7 @@ package Echolot::Config; # (c) 2002 Peter Palfrader <peter@palfrader.org> -# $Id: Config.pm,v 1.29 2002/07/17 17:53:44 weasel Exp $ +# $Id: Config.pm,v 1.30 2002/07/17 18:53:15 weasel Exp $ # =pod @@ -73,6 +73,7 @@ sub init($) { seperate_rlists => 0, combined_list => 0, thesaurus => 1, + stats_sort_by_latency => 0, # Timers and Counters processmail => 60, # process incomng mail every minute 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; |