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

[Xen-devel] [OSSTEST PATCH 07/14] Reporting: sg-report-host-history: Support --max-flight



We can't use report_blessingscond because we handle blessings
differently in sg-report-host-history (since we want the history of
even adhoc etc. flights).

Signed-off-by: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
Acked-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
---
 sg-report-host-history |    6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/sg-report-host-history b/sg-report-host-history
index f4e73e9..208da55 100755
--- a/sg-report-host-history
+++ b/sg-report-host-history
@@ -31,6 +31,7 @@ our $limit= 200;
 our $flightlimit;
 our $htmlout = ".";
 our @blessings;
+our $maxflight;
 
 open DEBUG, ">/dev/null";
 
@@ -44,6 +45,8 @@ while (@ARGV && $ARGV[0] =~ m/^-/) {
         $$1= $2;
     } elsif (m/^--flight-limit\=([1-9]\d*)$/) {
        $flightlimit= $1;
+    } elsif (m/^--max-flight\=([1-9]\d*)$/) {
+       $maxflight= $1;
     } elsif (m/^--blessings?=(.*)$/) {
         push @blessings, split ',', $1;
     } elsif (m/^--html-dir=(.*)$/) {
@@ -59,6 +62,7 @@ while (@ARGV && $ARGV[0] =~ m/^-/) {
 
 @ARGV or die $!;
 
+our $maxflightcond = defined($maxflight) ? "flight <= $maxflight" : "TRUE";
 our $flightcond;
 
 sub computeflightsrange () {
@@ -85,6 +89,7 @@ END
          FROM (
            SELECT flight
              FROM flights
+             WHERE $maxflightcond
             ORDER BY flight DESC
             LIMIT $flightlimit
          ) f
@@ -116,6 +121,7 @@ sub mainquery () {
         WHERE $namecond
           AND ($valcond)
           AND $flightcond
+           AND $maxflightcond
         ORDER BY flight DESC
         LIMIT ($limit * 3 + 100) * ?
 END
-- 
1.7.10.4


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


 


Rackspace

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