summaryrefslogtreecommitdiffstats
path: root/lib/Smokeping/matchers
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Smokeping/matchers')
-rw-r--r--lib/Smokeping/matchers/Avgratio.pm (renamed from lib/Smokeping/matchers/avgratio.pm)18
-rw-r--r--lib/Smokeping/matchers/Median.pm (renamed from lib/Smokeping/matchers/median.pm)8
-rw-r--r--lib/Smokeping/matchers/base.pm11
3 files changed, 20 insertions, 17 deletions
diff --git a/lib/Smokeping/matchers/avgratio.pm b/lib/Smokeping/matchers/Avgratio.pm
index fab0164..8679fe9 100644
--- a/lib/Smokeping/matchers/avgratio.pm
+++ b/lib/Smokeping/matchers/Avgratio.pm
@@ -1,21 +1,21 @@
-package Smokeping::matchers::avgratio;
+package Smokeping::matchers::Avgratio;
=head1 NAME
-Smokeping::matchers::avgratio - detect changes in average median latency
+Smokeping::matchers::Avgratio - detect changes in average median latency
=head1 OVERVIEW
-The avgratio matcher establishes a historic average median latency over
+The Avgratio matcher establishes a historic average median latency over
several measurement rounds. It compares this average, against a second
-average latency value again build over several rounds of measurment.
+average latency value again build over several rounds of measurement.
=head1 DESCRIPTION
Call the matcher with the following sequence:
type = matcher
- pattern = avgratio(historic=>a,current=>b,comparator=>o,percentage=>p)
+ pattern = Avgratio(historic=>a,current=>b,comparator=>o,percentage=>p)
=over
@@ -41,15 +41,15 @@ Right hand side of the comparison.
=head1 EXAMPLE
-Take build the average median latency over 10 samples, use this to divid the
+Take build the average median latency over 10 samples, use this to divide the
current average latency built over 2 samples and check if it is bigger than
150%.
- avgratio(historic=>10,current=>2,comparator=>'>',percentage=>150);
+ Avgratio(historic=>10,current=>2,comparator=>'>',percentage=>150);
avg(current)/avg(historic) > 150/100
-This means the matcher will activate when the current latency average if
+This means the matcher will activate when the current latency average is
more than 1.5 times the historic latency average established over the last
10 rounds of measurement.
@@ -59,7 +59,7 @@ Copyright (c) 2004 by OETIKER+PARTNER AG. All rights reserved.
=head1 SPONSORSHIP
-The development of this matcher has been sponsored by Virtela Communications www.virtela.net.
+The development of this matcher has been sponsored by Virtela Communications, L<http://www.virtela.net/>.
=head1 LICENSE
diff --git a/lib/Smokeping/matchers/median.pm b/lib/Smokeping/matchers/Median.pm
index e8d43cf..3c8560a 100644
--- a/lib/Smokeping/matchers/median.pm
+++ b/lib/Smokeping/matchers/Median.pm
@@ -1,8 +1,8 @@
-package Smokeping::matchers::median;
+package Smokeping::matchers::Median;
=head1 NAME
-Smokeping::matchers::median - Find persistant change in latency
+Smokeping::matchers::Median - Find persistant changes in latency
=head1 OVERVIEW
@@ -18,7 +18,7 @@ give a match.
Call the matcher with the following sequence:
type = matcher
- pattern = median(old=>x,new=>y,diff=>z)
+ pattern = Median(old=>x,new=>y,diff=>z)
This will create a matcher which consumes x+y latency-datapoints, builds the
two medians and the matches if the difference between the median latency is
@@ -64,7 +64,7 @@ sub Length($)
}
sub Desc ($) {
- croak "Finde changes in median latency";
+ croak "Find changes in median latency";
}
sub Test($$)
diff --git a/lib/Smokeping/matchers/base.pm b/lib/Smokeping/matchers/base.pm
index cd69871..130634f 100644
--- a/lib/Smokeping/matchers/base.pm
+++ b/lib/Smokeping/matchers/base.pm
@@ -7,9 +7,12 @@ Smokeping::matchers::base - Base Class for implementing SmokePing Matchers
=head1 OVERVIEW
This is the base class for writing SmokePing matchers. Every matcher must
-inherit from the base class and provide it's own methods for the 'buisness'
+inherit from the base class and provide it's own methods for the 'business'
logic.
+Note that the actual matchers must have at least one capital letter in their
+name, to differentiate them from the base class(es).
+
=head1 DESCRIPTION
Every matcher must provide the following methods:
@@ -29,7 +32,7 @@ The new method expects hash elements as an argument
eg new({x=>'\d+',y=>'\d+'},x=>1,y=>2). The first part is
a syntax rule for the arguments it should expect and the second part
are the arguments itself. The first part will be supplied
-by the child class as it calls the partent method.
+by the child class as it calls the parent method.
=cut
@@ -41,7 +44,7 @@ sub new(@)
my $self = { param => { @_ } };
foreach my $key (keys %{$self->{param}}){
my $regex = $rules->{$key};
- croak "key '$key' is not known byt this matcher" unless defined $rules->{$key};
+ croak "key '$key' is not known by this matcher" unless defined $rules->{$key};
croak "key '$key' contains invalid data: '$self->{param}{$key}'" unless $self->{param}{$key} =~ m/^$regex$/;
}
bless $self, $class;
@@ -77,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 of two arrays giving it access to both rtt and loss values.
my $data=shift;
my @rtt = @{$data->{rtt}};