summaryrefslogtreecommitdiff
path: root/Echolot
diff options
context:
space:
mode:
authorPeter Palfrader <peter@palfrader.org>2003-02-17 07:22:49 +0000
committerPeter Palfrader <peter@palfrader.org>2003-02-17 07:22:49 +0000
commit2123fb6af0fa319ff43286580d035e8f986e4397 (patch)
tree4fa5c9b99c1d9c9ccb730fd9e7d8c69685a46add /Echolot
parent4e4b74364edea060a70bda3bacc848eb2a26dad5 (diff)
Some changes wrt what we consider for intensive care and changes to timers
Diffstat (limited to 'Echolot')
-rw-r--r--Echolot/Chain.pm8
-rw-r--r--Echolot/Config.pm4
-rw-r--r--Echolot/Stats.pm8
3 files changed, 12 insertions, 8 deletions
diff --git a/Echolot/Chain.pm b/Echolot/Chain.pm
index 2f2ca52..02604ad 100644
--- a/Echolot/Chain.pm
+++ b/Echolot/Chain.pm
@@ -1,7 +1,7 @@
package Echolot::Chain;
# (c) 2002 Peter Palfrader <peter@palfrader.org>
-# $Id: Chain.pm,v 1.6 2003/02/16 10:07:27 weasel Exp $
+# $Id: Chain.pm,v 1.7 2003/02/17 07:22:49 weasel Exp $
#
=pod
@@ -195,7 +195,11 @@ sub set_intensive_care($@) {
my ($chaintype, $intensive_care) = @_;
%{$INTENSIVE_CARE{$chaintype}} = map { ($_->{'addr1'}.' '.$_->{'addr2'}) => $_->{'reason'} } @$intensive_care;
- Echolot::Log::debug("intensive care $chaintype:\n" . join("\n", map { "\t\t$_: $INTENSIVE_CARE{$chaintype}->{$_}" } keys %{$INTENSIVE_CARE{$chaintype}} ));
+ if (scalar @$intensive_care) {
+ Echolot::Log::debug("intensive care $chaintype:\n" . join("\n", map { "\t\t$_: $INTENSIVE_CARE{$chaintype}->{$_}" } keys %{$INTENSIVE_CARE{$chaintype}} ));
+ } else {
+ Echolot::Log::debug("intensive care $chaintype: (none)");
+ };
};
sub receive($$$) {
diff --git a/Echolot/Config.pm b/Echolot/Config.pm
index 9c7405c..4b6a6fb 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.56 2003/02/16 14:40:43 weasel Exp $
+# $Id: Config.pm,v 1.57 2003/02/17 07:22:49 weasel Exp $
#
=pod
@@ -101,7 +101,7 @@ sub init($) {
ping_every_nth_time => 48, # send out pings to the same remailer every 48 calls, i.e. every 4 hours
chainpinger_interval => 5*60, # send out pings every 5 minutes
- chainping_every_nth_time => 864, # send out pings to the same chain every 864 calls, i.e. every 3 days
+ chainping_every_nth_time => 2016, # send out pings to the same chain every 2016 calls, i.e. week
chainping_ic_every_nth_time => 288, # send out pings to broken or unknown chains every 288 calls, i.e. every day
chainping_period => 10*24*60*60, # 12 days
chainping_fudge => 0.3, # if less than 0.3 * rel1 * rel2 make it, the chain is really broken
diff --git a/Echolot/Stats.pm b/Echolot/Stats.pm
index 5a100ea..4575562 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.47 2003/02/16 14:42:41 weasel Exp $
+# $Id: Stats.pm,v 1.48 2003/02/17 07:22:49 weasel Exp $
#
=pod
@@ -529,11 +529,11 @@ sub find_broken_chains($$$) {
my $theoretical_rel = $remailers{$addr1}->{'stats'}->{'avr_reliability'} *
$remailers{$addr2}->{'stats'}->{'avr_reliability'};
my $out = $stats->{$addr1}->{$addr2}->{'out'};
- ($out < Echolot::Config::get()->{'chainping_minsample'}) and
- push (@intensive_care, { addr1 => $addr1, addr2 => $addr2, reason => "only $out samples" }),
- next;
my $done = $stats->{$addr1}->{$addr2}->{'done'};
$done = 0 unless defined $done;
+ ($out < Echolot::Config::get()->{'chainping_minsample'} && $done == 0) and
+ push (@intensive_care, { addr1 => $addr1, addr2 => $addr2, reason => "only $out samples, none returned so far" }),
+ next;
($out > 0) or
Echolot::Log::debug("Should not devide through zero ($done/$out) for $addr1, $addr2."),
next;