]> xenbits.xensource.com Git - people/liuw/osstest.git/commitdiff
ms-flights-summary: Do gather_stats without GROUP BY
authorIan Jackson <ian.jackson@eu.citrix.com>
Fri, 15 Jul 2016 18:49:51 +0000 (18:49 +0000)
committerIan Jackson <ian.jackson@eu.citrix.com>
Fri, 15 Jul 2016 19:06:13 +0000 (19:06 +0000)
We are going to want to look at each job's Reso separately.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
ms-flights-summary

index 413b703339de83c180e1b717fdab3649c3025dae..98cca9019377c37f0b4ae0abae4fd16614ad39b0 100755 (executable)
@@ -119,14 +119,13 @@ sub gather_stats($) {
     my ($f) = @_;
 
     my $stats= $dbh_tests->selectall_arrayref(<<END);
-        SELECT status,COUNT(*) FROM jobs
+        SELECT job,status FROM jobs
            WHERE flight=$f->{Nr}
-            GROUP BY status
 END
     for my $row (@{$stats}) {
-       my ($stat,$count) = @$row;
-       $f->{Stats}{lc($stat)} = $count;
-       $global_stats{lc($stat)} += $count;
+       my ($job,$stat) = @$row;
+       $f->{Stats}{lc($stat)}++;
+       $global_stats{lc($stat)}++;
     }
 
     $f->{NrJobs} = keys %{$f->{Jobs}};