summaryrefslogtreecommitdiff
path: root/Echolot
diff options
context:
space:
mode:
Diffstat (limited to 'Echolot')
-rw-r--r--Echolot/Config.pm3
-rw-r--r--Echolot/Stats.pm6
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;