Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for {max,avg,min} autovacuum duration & fix autovacuum's system usage: CPU: ... line parsing #791

Merged
Merged
Prev Previous commit
Next Next commit
Search for vmin & vmax values
  • Loading branch information
franciscoreinolds committed Aug 9, 2023
commit 71c005033465b16ce5c2daa5b5b4ee61f2ddaa66
9 changes: 9 additions & 0 deletions pgbadger
Original file line number Diff line number Diff line change
Expand Up @@ -10518,6 +10518,15 @@ sub print_vacuum

if (exists $per_minute_info{$curdb}{$tm}{$h}{$m}{autovacuum}) {
$v_dataavg{vcount}{"$rd"} += ($per_minute_info{$curdb}{$tm}{$h}{$m}{autovacuum}{count} || 0);

# Search minimum and maximum during this minute
foreach my $s (keys %{$per_minute_info{$curdb}{$tm}{$h}{$m}{autovacuum}{second}}) {
$v_dataavg{vmax}{"$rd"} = $per_minute_info{$curdb}{$tm}{$h}{$m}{autovacuum}{second}{$s}
if ($per_minute_info{$curdb}{$tm}{$h}{$m}{autovacuum}{second}{$s} > $v_dataavg{vmax}{"$rd"});
$v_dataavg{vmin}{"$rd"} = $per_minute_info{$curdb}{$tm}{$h}{$m}{autovacuum}{second}{$s}
if ($per_minute_info{$curdb}{$tm}{$h}{$m}{autovacuum}{second}{$d} < $v_dataavg{vmin}{"$rd"});
}
delete $per_minute_info{$curdb}{$tm}{$h}{$m}{autovacuum};
}
if (exists $per_minute_info{$curdb}{$tm}{$h}{$m}{autoanalyze}) {
$v_dataavg{acount}{"$rd"} += ($per_minute_info{$curdb}{$tm}{$h}{$m}{autoanalyze}{count} || 0);
Expand Down