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

[Xen-devel] [OSSTEST PATCH 09/13] sg-report-host-history: Write cache entries for tail, too


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
  • Date: Fri, 8 Nov 2019 18:49:57 +0000
  • Authentication-results: esa4.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=ian.jackson@xxxxxxxxxxxxx; spf=Pass smtp.mailfrom=Ian.Jackson@xxxxxxxxxx; spf=None smtp.helo=postmaster@xxxxxxxxxxxxxxx
  • Cc: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
  • Delivery-date: Fri, 08 Nov 2019 18:50:23 +0000
  • Ironport-sdr: iuDOH+M18GYSD6pFx8G5usJ9uewfTLH8XRHI1iODnaEID7335XwoEowsI6b9ewBJbZsQ7OZkv0 EOZYJNAWhg3jSwnCWWCmW2dFM3JjjZz5YuOI7CmZI8bC2LEQt7aYvN9+uPeqR8vg6sW98k2eQ4 6N4rA4P9drKwSBqJZ09yxp/yF3LK30unKOgUlIeOn+aVmHHD08cLIqxbGBzdddueb7bEoGiwBE 2hRuIJ94yp0D3WkOcSu85+AS7QSryJ6m3ng0dWi7+uwMP6s3Zfs3N7nD/7M4VYLww7vWMCudmi Du8=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

mainquery fetches a number of rows supposed to be larger than needed
for the output limit $limit.  And then for each host we sort them by
time of the last step - which means we must have the last step, which
is a separate query for each job.  We want to cache this information
even for jobs we do not actually report in the html output.

(There is still nothing which actually reads this cache data.)

Signed-off-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
---
 sg-report-host-history | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/sg-report-host-history b/sg-report-host-history
index 335efa1c..7dcfac9a 100755
--- a/sg-report-host-history
+++ b/sg-report-host-history
@@ -268,10 +268,15 @@ END
     };
 
     @rows = sort { $b->{finished} <=> $a->{finished} } @rows;
-    $#rows = $limit-1 if @rows > $limit;
 
     my $alternate = 0;
+    my $wrote = 0;
     foreach my $jr (@rows) {
+       if ($wrote++ >= $limit) {
+           $write_cache_entry->($jr);
+           next;
+       }
+
         print DEBUG "JR $jr->{flight}.$jr->{job}\n";
        my $ir = jobquery($infoq, $jr, 'i');
        my $ar = jobquery($allocdq, $jr, 'a');
-- 
2.11.0


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

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