]> granicus.if.org Git - pgbadger/commitdiff
Fix wrong average duration on query that generate the most locks. Thanks to Pascal...
authorDarold Gilles <gilles@darold.net>
Fri, 8 Aug 2014 13:30:45 +0000 (15:30 +0200)
committerDarold Gilles <gilles@darold.net>
Fri, 8 Aug 2014 13:30:45 +0000 (15:30 +0200)
pgbadger

index 68e48add7767408098b8a5253e7b78b6c0665707..a052d091bbf6633d2b7664bd859eaac3dd507ad9 100755 (executable)
--- a/pgbadger
+++ b/pgbadger
@@ -3110,7 +3110,7 @@ Report not supported by text format
                        last if ($i > $end_top);
                        print $fh ($i + 1), ")   ", $top_locked_queries[$i]->[1], " - ", &convert_time($top_locked_queries[$i]->[2]),
                        " - ", &convert_time($top_locked_queries[$i]->[3]), "/", &convert_time($top_locked_queries[$i]->[4]), "/",
-                       &convert_time(($top_locked_queries[$i]->[4] / $top_locked_queries[$i]->[1])),
+                       &convert_time(($top_locked_queries[$i]->[2] / $top_locked_queries[$i]->[1])),
                        " - ", $top_locked_queries[$i]->[0], "\n";
                        print $fh "--\n";
                        my $k = $top_locked_queries[$i]->[0];
@@ -6531,7 +6531,7 @@ sub print_lock_queries_report
                my $total_time = &convert_time($top_locked_queries[$i]->[2]);
                my $min_time = &convert_time($top_locked_queries[$i]->[3]);
                my $max_time = &convert_time($top_locked_queries[$i]->[4]);
-               my $avg_time = &convert_time($top_locked_queries[$i]->[4] / ($top_locked_queries[$i]->[1] || 1));
+               my $avg_time = &convert_time($top_locked_queries[$i]->[2] / ($top_locked_queries[$i]->[1] || 1));
                my $query = &highlight_code($top_locked_queries[$i]->[0]);
                my $k = $top_locked_queries[$i]->[0];
                my $example = qq{<p><button type="button" class="btn btn-mini" data-toggle="collapse" data-target="#queries-most-frequent-waiting-examples-rank-$rank">Examples</button></p>};