summaryrefslogtreecommitdiff
path: root/fml/lib/FML/Error.pm
diff options
context:
space:
mode:
authorfukachan <fukachan>2002-08-16 00:59:06 +0000
committerfukachan <fukachan>2002-08-16 00:59:06 +0000
commit876c1376308265db8337f269c5d6ce2569e7df8c (patch)
tree1a4de4f57454a3adf879a6464f7b0445f5209d2b /fml/lib/FML/Error.pm
parent4402d0158582b8187211cec734ccd53602f8e200 (diff)
downloadfml8-876c1376308265db8337f269c5d6ce2569e7df8c.tar.gz
fml8-876c1376308265db8337f269c5d6ce2569e7df8c.tar.bz2
fml8-876c1376308265db8337f269c5d6ce2569e7df8c.zip
move analyzer function() to FML::Error::Analyze
Diffstat (limited to 'fml/lib/FML/Error.pm')
-rw-r--r--fml/lib/FML/Error.pm58
1 files changed, 12 insertions, 46 deletions
diff --git a/fml/lib/FML/Error.pm b/fml/lib/FML/Error.pm
index 7ef3492a..82bb3fd8 100644
--- a/fml/lib/FML/Error.pm
+++ b/fml/lib/FML/Error.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: Error.pm,v 1.3 2002/08/09 08:37:24 fukachan Exp $
+# $FML: Error.pm,v 1.4 2002/08/15 04:21:52 fukachan Exp $
#
package FML::Error;
@@ -13,6 +13,7 @@ use vars qw(@ISA @EXPORT @EXPORT_OK $AUTOLOAD);
use Carp;
use FML::Log qw(Log LogWarn LogError);
+
my $debug = 1;
@@ -44,65 +45,30 @@ sub new
}
+# Descriptions: analyzer
+# Arguments: OBJ($self)
+# Side Effects: none
+# Return Value: none
sub analyze
{
my ($self) = @_;
my $curproc = $self->{ _curproc };
+ my $config = $curproc->config();
use FML::Error::Cache;
my $cache = new FML::Error::Cache $curproc;
my $rdata = $cache->get_all_values_as_hash_ref();
- my $list = $self->md_analyze($curproc, $rdata);
+
+ use FML::Error::Analyze;
+ my $analyzer = new FML::Error::Analyze $curproc;
+ my $fp = $config->{ error_analyzer_function } || 'simple_count';
+ my $list = $analyzer->$fp($curproc, $rdata);
# pass address list to remove
$self->{ _remove_addr_list } = $list;
}
-# *** model specific analyzer ***
-# $data = {
-# address => [
-# error_string_1,
-# error_string_2, ...
-# ]
-# };
-
-sub md_analyze
-{
- my ($self, $curproc, $data) = @_;
- my ($addr, $bufarray, $count);
- my @removelist = ();
- my $debug = {};
-
- while (($addr, $bufarray) = each %$data) {
- $count = 0;
- if (defined $bufarray) {
- for my $buf (@$bufarray) {
- if ($buf =~ /status=5/i) {
- $count++;
- $debug->{ $addr } = $count;
- }
- }
- }
-
- if ($count > 5) {
- push(@removelist, $addr);
- }
- }
-
- # debug info
- {
- Log("analyze summary");
- my ($k, $v);
- while (($k, $v) = each %$debug) {
- Log("summary: $k = $v points");
- }
- }
-
- return \@removelist;
-}
-
-
# Descriptions: delete addresses analyze() determines as bouncers
# Arguments: OBJ($self)
# Side Effects: none