~ubuntu-branches/debian/experimental/smokeping/experimental

« back to all changes in this revision

Viewing changes to doc/Smokeping/matchers/base.txt

  • Committer: Bazaar Package Importer
  • Author(s): Niko Tyni
  • Date: 2008-08-29 18:29:34 UTC
  • mfrom: (2.1.14 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080829182934-ad5b9csusoqn1155
Tags: 2.3.6-3
* Unset LC_ALL in the init script because the daemon needs to 
  reset LC_NUMERIC. (Closes: #489766)
* Fix a bashism in the postinst script. Thanks, lintian.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
Smokeping::matchers::base(3)SmokePingSmokeping::matchers::base(3)
 
1
Smokeping::matchers::base(3)       SmokePing      Smokeping::matchers::base(3)
2
2
 
3
3
 
4
4
 
5
5
NNAAMMEE
6
 
       Smokeping::matchers::base - Base Class for implementing
7
 
       SmokePing Matchers
 
6
       Smokeping::matchers::base - Base Class for implementing SmokePing
 
7
       Matchers
8
8
 
9
9
OOVVEERRVVIIEEWW
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 'business' logic.
 
10
       This is the base class for writing SmokePing matchers. Every matcher
 
11
       must inherit from the base class and provide it's own methods for the
 
12
       'business' logic.
13
13
 
14
 
       Note that the actual matchers must have at least one capi-
15
 
       tal letter in their name, to differentiate them from the
16
 
       base class(es).
 
14
       Note that the actual matchers must have at least one capital letter in
 
15
       their name, to differentiate them from the base class(es).
17
16
 
18
17
DDEESSCCRRIIPPTTIIOONN
19
18
       Every matcher must provide the following methods:
21
20
       nneeww
22
21
 
23
22
       The new method expects hash elements as an argument eg
24
 
       new({x=>'\d+',y=>'\d+'},x=>1,y=>2). The first part is a
25
 
       syntax rule for the arguments it should expect and the
26
 
       second part are the arguments itself. The first part will
27
 
       be supplied by the child class as it calls the parent
28
 
       method.
 
23
       new({x=>'\d+',y=>'\d+'},x=>1,y=>2). The first part is a syntax rule for
 
24
       the arguments it should expect and the second part are the arguments
 
25
       itself. The first part will be supplied by the child class as it calls
 
26
       the parent method.
29
27
 
30
28
       LLeennggtthh
31
29
 
32
 
       The Length method returns the number of values the matcher
33
 
       will expect from SmokePing. This method must be overridden
34
 
       by the children of the base class.
 
30
       The Length method returns the number of values the matcher will expect
 
31
       from SmokePing. This method must be overridden by the children of the
 
32
       base class.
35
33
 
36
34
       DDeesscc
37
35
 
38
 
       Simply return the description of the function. This method
39
 
       must be overwritten by a children of the base class.
 
36
       Simply return the description of the function. This method must be
 
37
       overwritten by a children of the base class.
40
38
 
41
39
       TTeesstt
42
40
 
43
 
       Run the matcher and return true or false. The Test method
44
 
       is called with a hash containing two arrays giving it
45
 
       access to both rtt and loss values.
 
41
       Run the matcher and return true or false. The Test method is called
 
42
       with a hash containing two arrays giving it access to both rtt and loss
 
43
       values.
46
44
 
47
45
         my $data=shift;
48
46
         my @rtt = @{$data->{rtt}};
52
50
 
53
51
         @rdd[old..new]
54
52
 
55
 
       There may be more than the expected number of elements in
56
 
       this array. Address them with $x[-1] to $x[-max].
 
53
       There may be more than the expected number of elements in this array.
 
54
       Address them with $x[-1] to $x[-max].
57
55
 
58
 
       There's also a key called 'prevmatch' in the hash. It con-
59
 
       tains the value returned by the previous call of the
60
 
       'Test' method. This allows for somewhat more intelligent
61
 
       alerting due to state awareness.
 
56
       There's also a key called 'prevmatch' in the hash. It contains the
 
57
       value returned by the previous call of the 'Test' method. This allows
 
58
       for somewhat more intelligent alerting due to state awareness.
62
59
 
63
60
         my $prevmatch = $data->{prevmatch};
64
61
 
65
62
CCOOPPYYRRIIGGHHTT
66
 
       Copyright (c) 2004 by OETIKER+PARTNER AG. All rights
67
 
       reserved.
 
63
       Copyright (c) 2004 by OETIKER+PARTNER AG. All rights reserved.
68
64
 
69
65
LLIICCEENNSSEE
70
 
       This program is free software; you can redistribute it
71
 
       and/or modify it under the terms of the GNU General Public
72
 
       License as published by the Free Software Foundation;
73
 
       either version 2 of the License, or (at your option) any
74
 
       later version.
75
 
 
76
 
       This program is distributed in the hope that it will be
77
 
       useful, but WITHOUT ANY WARRANTY; without even the implied
78
 
       warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
79
 
       PURPOSE.  See the GNU General Public License for more
80
 
       details.
81
 
 
82
 
       You should have received a copy of the GNU General Public
83
 
       License along with this program; if not, write to the Free
84
 
       Software Foundation, Inc., 675 Mass Ave, Cambridge, MA
85
 
       02139, USA.
 
66
       This program is free software; you can redistribute it and/or modify it
 
67
       under the terms of the GNU General Public License as published by the
 
68
       Free Software Foundation; either version 2 of the License, or (at your
 
69
       option) any later version.
 
70
 
 
71
       This program is distributed in the hope that it will be useful, but
 
72
       WITHOUT ANY WARRANTY; without even the implied warranty of MER-
 
73
       CHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General
 
74
       Public License for more details.
 
75
 
 
76
       You should have received a copy of the GNU General Public License along
 
77
       with this program; if not, write to the Free Software Foundation, Inc.,
 
78
       675 Mass Ave, Cambridge, MA 02139, USA.
86
79
 
87
80
AAUUTTHHOORR
88
81
       Tobias Oetiker <tobi@oetiker.ch>
89
82
 
90
83
 
91
84
 
92
 
2.0.9                       2006-07-14Smokeping::matchers::base(3)
 
85
2.3.6                             2006-07-12      Smokeping::matchers::base(3)