[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [OSSTEST PATCH 2/5] ms-flights-summary: Do gather_stats without GROUP BY



We are going to want to look at each job's Reso separately.

Signed-off-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
---
 ms-flights-summary | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/ms-flights-summary b/ms-flights-summary
index 413b703..98cca90 100755
--- a/ms-flights-summary
+++ b/ms-flights-summary
@@ -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}};
-- 
2.1.4


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.