]> granicus.if.org Git - pgbadger/commitdiff
Fix issue on per minute minimum value
authorDarold Gilles <gilles@darold.net>
Tue, 10 Jul 2012 14:53:35 +0000 (16:53 +0200)
committerDarold Gilles <gilles@darold.net>
Tue, 10 Jul 2012 14:53:35 +0000 (16:53 +0200)
pgbadger

index 20def44fc3ce1b18eab304d1a8cde904b1de51cd..e4e725bf0638796d2018d66093fe886ebd91395b 100755 (executable)
--- a/pgbadger
+++ b/pgbadger
@@ -1616,7 +1616,7 @@ sub dump_as_html
                                                        # Search minimum and maximum during this minute
                                                        foreach my $s (keys %{$per_minute_info{query}{$tm}{$h}{$m}{second}}) {
                                                                $dataavg{max}{"$rd"} = $per_minute_info{query}{$tm}{$h}{$m}{second}{$s} if ($per_minute_info{query}{$tm}{$h}{$m}{second}{$s} > $dataavg{max}{"$rd"});
-                                                               $dataavg{min}{"$rd"} = $per_minute_info{query}{$tm}{$h}{$m}{second}{$s} if (!$dataavg{min}{"$rd"} || ($per_minute_info{query}{$tm}{$h}{$m}{second}{$s} < $dataavg{min}{"$rd"}));
+                                                               $dataavg{min}{"$rd"} = $per_minute_info{query}{$tm}{$h}{$m}{second}{$s} if (not exists $dataavg{min}{"$rd"} || ($per_minute_info{query}{$tm}{$h}{$m}{second}{$s} < $dataavg{min}{"$rd"}));
                                                        }
                                                }
                                        }
@@ -1656,7 +1656,7 @@ sub dump_as_html
                                                        # Search minimum and maximum during this minute
                                                        foreach my $s (keys %{$per_minute_info{connection}{$tm}{$h}{$m}{second}}) {
                                                                $dataavg{max}{"$rd"} = $per_minute_info{connection}{$tm}{$h}{$m}{second}{$s} if ($per_minute_info{connection}{$tm}{$h}{$m}{second}{$s} > $dataavg{max}{"$rd"});
-                                                               $dataavg{min}{"$rd"} = $per_minute_info{connection}{$tm}{$h}{$m}{second}{$s} if (!$dataavg{min}{"$rd"} || ($per_minute_info{connection}{$tm}{$h}{$m}{second}{$s} < $dataavg{min}{"$rd"}));
+                                                               $dataavg{min}{"$rd"} = $per_minute_info{connection}{$tm}{$h}{$m}{second}{$s} if (not exists $dataavg{min}{"$rd"} || ($per_minute_info{connection}{$tm}{$h}{$m}{second}{$s} < $dataavg{min}{"$rd"}));
                                                        }
                                                }
                                        }