diff options
author | Greg Sabino Mullane | 2010-02-04 15:55:04 +0000 |
---|---|---|
committer | Greg Sabino Mullane | 2010-02-04 15:55:04 +0000 |
commit | b63d744c2ed55fc848215789323739741c27082c (patch) | |
tree | 6e2f84127b75765361ec080cc9a00498c3f67b71 /check_postgres.pl | |
parent | cb0e457bff884fdb1950afd4325883b70324b57d (diff) |
Respesct perflimit on main output of sequence action.
Diffstat (limited to 'check_postgres.pl')
-rwxr-xr-x | check_postgres.pl | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/check_postgres.pl b/check_postgres.pl index cd467b77b..69700508e 100755 --- a/check_postgres.pl +++ b/check_postgres.pl @@ -5963,6 +5963,8 @@ sub check_sequence { my $MAXINT4 = 2147483647; my $MAXINT8 = 9223372036854775807; + my $limit = 0; + for $db (@{$info->{db}}) { my (@crit,@warn,@ok); my $maxp = 0; @@ -5987,7 +5989,9 @@ sub check_sequence { $seqperf{$percent}{$seqname} = [$left, " $multidb$seqname=$percent|$slots|$used|$left"]; if ($percent >= $maxp) { $maxp = $percent; - push @{$seqinfo{$percent}} => $MRTG ? [$seqname,$percent,$slots,$used,$left] : $msg; + if (! exists $opt{perflimit} or $limit++ < $opt{perflimit}) { + push @{$seqinfo{$percent}} => $MRTG ? [$seqname,$percent,$slots,$used,$left] : $msg; + } } next if $MRTG; @@ -6002,7 +6006,7 @@ sub check_sequence { my $msg = join ' | ' => map { $_->[0] } @{$seqinfo{$maxp}}; do_mrtg({one => $maxp, msg => $msg}); } - my $limit = 0; + $limit = 0; PERF: for my $val (sort { $b <=> $a } keys %seqperf) { for my $seq (sort { $seqperf{$val}{$a}->[0] <=> $seqperf{$val}{$b}->[0] or $a cmp $b } keys %{$seqperf{$val}}) { last PERF if exists $opt{perflimit} and $limit++ >= $opt{perflimit}; |