1
matchers::base(3) SmokePing matchers::base(3)
6
matchers::base - Base Class for implementing SmokePing
10
This is the base class for writing SmokePing matchers.
11
Every matcher must inherit from the base class and provide
12
it's own methods for the 'buisness' logic.
14
DDEESSCCRRIIPPTTIIOONN
15
Every matcher must provide the following methods:
19
The new method expects hash elements as an argument eg
20
new({x=>'\d+',y=>'\d+'},x=>1,y=>2). The first part is a
21
syntax rule for the arguments it should expect and the
22
second part are the arguments itself. The first part will
23
be supplied by the child class as it calls the partent
28
The Length method returns the number of values the matcher
29
will expect from SmokePing. This method must be overridden
30
by the children of the base class.
34
Simply return the description of the function. This method
35
must be overwritten by a children of the base class.
39
Run the matcher and return true or false. The Test method
40
is called with a hash of two arrays giving it access to
41
both rtt and loss values
44
my @rtt = @{$data->{rtt}};
45
my @loss = @{$data->{loss}};
47
The arrays are ordered from old to new.
51
There may be more than the expected number of elements in
52
this array. Address them with $x[-1] to $x[-max].
55
Copyright (c) 2004 by OETIKER+PARTNER AG. All rights
59
This program is free software; you can redistribute it
60
and/or modify it under the terms of the GNU General Public
61
License as published by the Free Software Foundation;
62
either version 2 of the License, or (at your option) any
65
This program is distributed in the hope that it will be
66
useful, but WITHOUT ANY WARRANTY; without even the implied
67
warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
68
PURPOSE. See the GNU General Public License for more
71
You should have received a copy of the GNU General Public
72
License along with this program; if not, write to the Free
73
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA
77
Tobias Oetiker <tobi@oetiker.ch>
81
1.34 2004-11-29 matchers::base(3)