diff options
| author | fukachan <fukachan> | 2006-11-19 02:24:52 +0000 |
|---|---|---|
| committer | fukachan <fukachan> | 2006-11-19 02:24:52 +0000 |
| commit | 7e7028046b3195ac7121bd74b137c9d419176e7b (patch) | |
| tree | 07e486e8311b1ee861fd780a42355d439cec6ec3 /fml/lib/FML/Error | |
| parent | 8f209d07b7f37ed043f3abfa752473fc6db9d3a8 (diff) | |
| download | fml8-7e7028046b3195ac7121bd74b137c9d419176e7b.tar.gz fml8-7e7028046b3195ac7121bd74b137c9d419176e7b.tar.bz2 fml8-7e7028046b3195ac7121bd74b137c9d419176e7b.zip | |
fix comments.
use more proper variable names.
Diffstat (limited to 'fml/lib/FML/Error')
| -rw-r--r-- | fml/lib/FML/Error/Analyze.pm | 18 | ||||
| -rw-r--r-- | fml/lib/FML/Error/Analyze/histgram.pm | 45 | ||||
| -rw-r--r-- | fml/lib/FML/Error/Analyze/simple_count.pm | 7 | ||||
| -rw-r--r-- | fml/lib/FML/Error/Cache.pm | 29 |
4 files changed, 58 insertions, 41 deletions
diff --git a/fml/lib/FML/Error/Analyze.pm b/fml/lib/FML/Error/Analyze.pm index df82ebc7..0cab2be7 100644 --- a/fml/lib/FML/Error/Analyze.pm +++ b/fml/lib/FML/Error/Analyze.pm @@ -4,7 +4,7 @@ # All rights reserved. This program is free software; you can # redistribute it and/or modify it under the same terms as Perl itself. # -# $FML: Analyze.pm,v 1.32 2005/08/17 12:08:46 fukachan Exp $ +# $FML: Analyze.pm,v 1.33 2006/02/15 13:44:04 fukachan Exp $ # package FML::Error::Analyze; @@ -18,7 +18,7 @@ my $debug = 1; =head1 NAME -FML::Error::Analyze - provide model specific analyzer routines. +FML::Error::Analyze - dispatch model specific analyzer routines. =head1 SYNOPSIS @@ -37,6 +37,9 @@ FML::Error::Analyze - provide model specific analyzer routines. =head1 DESCRIPTION +This class provides a top level dispatcher for +model specific analyzer routines. + =head1 METHODS =head2 new() @@ -66,8 +69,8 @@ sub new return summary of address and points as HASH_REF. $summary = { - address1 => point, - address2 => point, + address1 => point1, + address2 => point2, }; =head2 get_address_to_be_deleted() @@ -113,6 +116,13 @@ sub get_address_to_be_deleted } +=head2 print() + +print address and the status summary. + +=cut + + # Descriptions: print address and the status summary. # Arguments: OBJ($self) STR($addr) # Side Effects: none diff --git a/fml/lib/FML/Error/Analyze/histgram.pm b/fml/lib/FML/Error/Analyze/histgram.pm index 1cc2a5e5..37d3343e 100644 --- a/fml/lib/FML/Error/Analyze/histgram.pm +++ b/fml/lib/FML/Error/Analyze/histgram.pm @@ -4,7 +4,7 @@ # All rights reserved. This program is free software; you can # redistribute it and/or modify it under the same terms as Perl itself. # -# $FML: histgram.pm,v 1.14 2005/08/17 12:08:45 fukachan Exp $ +# $FML: histgram.pm,v 1.15 2006/02/15 13:44:04 fukachan Exp $ # package FML::Error::Analyze::histgram; @@ -21,14 +21,35 @@ FML::Error::Analyze::histgram - cost evaluator. =head1 SYNOPSIS + my $analyzer = new FML::Error::Analyze::histgram; + $analyzer->process($curproc, $data); + =head1 DESCRIPTION +This class provides analysis based on the histgram model. + +It examines the continuity of error messages (*). + + --------------------> time + * ok + ********* bad + * * *** * ambiguous + +but sum up counts by the delta. + + * + *** + =head1 METHODS =head2 new($curproc) constructor. +=head2 process($curproc, $data) + +dispatch analysis. + =cut @@ -56,26 +77,10 @@ sub process } -=head2 histgram() - - examine the continuity of error messages (*). - --------------------> time - * ok - ********* bad - * * *** * ambiguous - -but sum up count as the delta. - - * - *** - -=cut - - # Descriptions: error continuity based cost counting. # Arguments: OBJ($self) OBJ($curproc) HASH_REF($data) # Side Effects: none -# Return Value: ARRAY_REF +# Return Value: none sub _histgram { my ($self, $curproc, $data) = @_; @@ -84,11 +89,11 @@ sub _histgram my $summary = {}; my $config = $curproc->config(); my $limit = $config->{ error_mail_analyzer_simple_count_limit } || 14; - my $daylimit = $config->{ error_mail_analyzer_day_limit } || 14; + my $howold = $config->{ error_mail_analyzer_day_limit } || 14; my $now = time; # unix time (seconds). my $half_day = 12 * 3600 ; # 12 hours (seconds). my $one_day = 24 * 3600 ; # 24 hours (seconds). - my $threshold = $one_day * $daylimit; # how old (seconds). + my $threshold = $one_day * $howold; # how old (seconds). # $data format = { # key1 => [ value1, value2, ... ], diff --git a/fml/lib/FML/Error/Analyze/simple_count.pm b/fml/lib/FML/Error/Analyze/simple_count.pm index f35e3b92..d0e875ae 100644 --- a/fml/lib/FML/Error/Analyze/simple_count.pm +++ b/fml/lib/FML/Error/Analyze/simple_count.pm @@ -4,7 +4,7 @@ # All rights reserved. This program is free software; you can # redistribute it and/or modify it under the same terms as Perl itself. # -# $FML: simple_count.pm,v 1.12 2005/08/17 12:08:45 fukachan Exp $ +# $FML: simple_count.pm,v 1.13 2006/02/15 13:44:04 fukachan Exp $ # package FML::Error::Analyze::simple_count; @@ -21,8 +21,13 @@ FML::Error::Analyze::simple_count - simple cost evaluator. =head1 SYNOPSIS + my $analyzer = new FML::Error::Analyze::simple_count; + $analyzer->process($curproc, $data); + =head1 DESCRIPTION +This class provides simple evaluation of the number of error messages. + =head1 METHODS =head2 new($curproc) diff --git a/fml/lib/FML/Error/Cache.pm b/fml/lib/FML/Error/Cache.pm index b94c03d0..f73cceda 100644 --- a/fml/lib/FML/Error/Cache.pm +++ b/fml/lib/FML/Error/Cache.pm @@ -4,7 +4,7 @@ # All rights reserved. This program is free software; you can # redistribute it and/or modify it under the same terms as Perl itself. # -# $FML: Cache.pm,v 1.22 2004/05/22 06:19:52 fukachan Exp $ +# $FML: Cache.pm,v 1.23 2004/07/23 13:16:37 fukachan Exp $ # package FML::Error::Cache; @@ -35,6 +35,8 @@ where C<$bounce_info) follows: =head1 DESCRIPTION +This class provides database manipluation. + =head1 METHODS =head2 new() @@ -46,7 +48,7 @@ constructor. # Descriptions: constructor. # Arguments: OBJ($self) HASH_REF($curproc) -# Side Effects: none +# Side Effects: create a cache directory. # Return Value: OBJ sub new { @@ -104,7 +106,7 @@ sub touch { 1;} =head2 add($address, $argv) -add data given as hash reference $argv. +add data given as hash reference $argv into the database. $argv = { address => STR, @@ -170,12 +172,12 @@ sub add =head2 delete($address) -delete entry for $address. +delete entry for the specified $address. =cut -# Descriptions: delete entry for $address. +# Descriptions: delete the entry for $address. # Arguments: OBJ($self) STR($address) # Side Effects: update cache # Return Value: none @@ -211,20 +213,15 @@ sub delete =head1 CACHE IO MANIPULATION You need to use primitive methods this class provides for IO into/from -error data cache. - -C<Tie::JournaledDir> is a simple hash, so $argv is converted to the -following a set of key ($address) and value. - - $address => "$unixtime status=$status reason=$reason" +error database (data cache). =cut # Descriptions: open the cache database for Tie::Journaled*. # Arguments: OBJ($self) -# Side Effects: none -# Return Value: HASH_REF +# Side Effects: set up $self->{ _db }. +# Return Value: none sub _open_cache { my ($self) = @_; @@ -304,12 +301,12 @@ sub get_all_values_as_hash_ref my $dir = $config->{ error_mail_analyzer_cache_dir }; use Tie::JournaledDir; - my $obj = new Tie::JournaledDir { dir => $dir }; - return $obj->get_all_values_as_hash_ref(); + my $cache = new Tie::JournaledDir { dir => $dir }; + return $cache->get_all_values_as_hash_ref(); } -# Descriptions: check if the address is valid string? +# Descriptions: check if the address is a valid string? # Arguments: OBJ($self) STR($address) # Side Effects: none # Return Value: NUM |
