From 8e6a401ce24a3c479bc2f24fe0f594b44d8aba1f Mon Sep 17 00:00:00 2001 From: Niko Tyni Date: Wed, 12 Jul 2006 17:32:39 +0000 Subject: * pass 'prevmatch' to alert matcher plugins. -- niko, from Dylan Vanderhoof (add to trunk as well) --- lib/Smokeping/matchers/base.pm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'lib/Smokeping/matchers/base.pm') diff --git a/lib/Smokeping/matchers/base.pm b/lib/Smokeping/matchers/base.pm index 130634f..0d69bcd 100644 --- a/lib/Smokeping/matchers/base.pm +++ b/lib/Smokeping/matchers/base.pm @@ -80,7 +80,7 @@ sub Desc ($) { =head2 Test Run the matcher and return true or false. The Test method is called -with a hash of two arrays giving it access to both rtt and loss values. +with a hash containing two arrays giving it access to both rtt and loss values. my $data=shift; my @rtt = @{$data->{rtt}}; @@ -93,6 +93,11 @@ The arrays are ordered from old to new. There may be more than the expected number of elements in this array. Address them with $x[-1] to $x[-max]. +There's also a key called 'prevmatch' in the hash. It contains the +value returned by the previous call of the 'Test' method. This allows +for somewhat more intelligent alerting due to state awareness. + + my $prevmatch = $data->{prevmatch}; =cut -- cgit v1.2.3-24-g4f1b