]> granicus.if.org Git - pgbadger/commitdiff
Fix sort order of days/hours into hours array
authorDarold <gilles@darold.net>
Wed, 18 Apr 2012 15:07:43 +0000 (17:07 +0200)
committerDarold <gilles@darold.net>
Wed, 18 Apr 2012 15:07:43 +0000 (17:07 +0200)
pgbadger

index c9dead18495d72de157d54db0fa96c289143e3bb..1c630470d7022e03c86ba1ca4c9d488b0d7be031 100755 (executable)
--- a/pgbadger
+++ b/pgbadger
@@ -961,11 +961,11 @@ sub dump_as_html
        </tr>
 };
 
-       foreach my $d (sort keys %per_hour_info) {
+       foreach my $d (sort {$a <=> $b} keys %per_hour_info) {
                my $c = 1;
                $d =~ /^\d{4}(\d{2})(\d{2})$/;
                my $zday = "$abbr_month{$1} $2";
-               foreach my $h (sort keys %{$per_hour_info{$d}}) {
+               foreach my $h (sort {$a <=> $b} keys %{$per_hour_info{$d}}) {
                        my $colb = $c % 2;
                        $zday = "&nbsp;" if ($c > 1);
                        $per_hour_info{$d}{$h}{average} = $per_hour_info{$d}{$h}{duration} / ($per_hour_info{$d}{$h}{count} || 1);