diff options
author | Niko Tyni <ntyni@iki.fi> | 2007-10-27 14:05:57 +0200 |
---|---|---|
committer | Niko Tyni <ntyni@iki.fi> | 2007-10-27 14:05:57 +0200 |
commit | 51243891b9e493882c59e582c5188f48e1127bed (patch) | |
tree | c7c0b4d1ca1686f13d3ebb71b050d5c4e9155f23 /lib/Smokeping/probes/base.pm | |
parent | 15ce7b9d28dda1afb6b892c1e2a34e057f3fdb60 (diff) | |
download | smokeping-51243891b9e493882c59e582c5188f48e1127bed.tar.gz smokeping-51243891b9e493882c59e582c5188f48e1127bed.tar.xz |
count the rounds when pinging, needed for smarter logging
Diffstat (limited to 'lib/Smokeping/probes/base.pm')
-rw-r--r-- | lib/Smokeping/probes/base.pm | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/lib/Smokeping/probes/base.pm b/lib/Smokeping/probes/base.pm index 7747b77..15cd03e 100644 --- a/lib/Smokeping/probes/base.pm +++ b/lib/Smokeping/probes/base.pm @@ -64,7 +64,7 @@ sub new($$) my $class = ref($this) || $this; my $self = { properties => shift, cfg => shift, name => shift, - targets => {}, rtts => {}, addrlookup => {}}; + targets => {}, rtts => {}, addrlookup => {}, rounds_count => 0}; bless $self, $class; return $self; } @@ -94,6 +94,18 @@ sub ProbeUnit ($) { return "Seconds"; } +# this is a read-only variable that should get incremented by +# the ping() method +sub rounds_count ($) { + my $self = shift; + return $self->{rounds_count}; +} + +sub increment_rounds_count ($) { + my $self = shift; + $self->{rounds_count}++; +} + sub target2dynfile ($$) { # the targets are stored in the $self->{targets} # hash as filenames pointing to the RRD files |