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

[OSSTEST PATCH 54/60] sg-report-job-history: Cache osstestrevs


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
  • Date: Fri, 14 Aug 2020 18:21:59 +0100
  • Authentication-results: esa4.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
  • Cc: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
  • Delivery-date: Fri, 14 Aug 2020 17:26:50 +0000
  • Ironport-sdr: IichEY6ZbjBfBltydfbxGNc45YhISME2fOnywk2FxnlR5Yi55yUdPVBUQdCZ+R3/xfjTVUvoVr D2eDWOwNYmeTiSRdecYPIFFAV87WYBsltBYIicUTlEYEdVXtcMYRQ1NEu60qM8Dlc3Cizss2+7 smCeAhgKQJmvF8R6x6aNgjG0xvJs70rwhVUsVnmZDrLAyf7x3zKVo1GBc3UCWndiCtYzt3KnBM 8LblB9vH6EohahVqiPCBGEBP/S0XcllJiU83/fU4Zi+BseQ/EgJZqeVjCXbyKMzcdj8gWzcgj3 IyU=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

No logical change.

Signed-off-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
---
 sg-report-job-history | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/sg-report-job-history b/sg-report-job-history
index d5e37bcd..48dc2f57 100755
--- a/sg-report-job-history
+++ b/sg-report-job-history
@@ -260,17 +260,20 @@ END
        my $hosts = join ", ", map { $r->{Hosts}{$_} // "-" } @hostvarcols;
        my $hosts_colour = report_altchangecolour(\$alt_hosts, $hosts);
        print H "<td $hosts_colour>".encode_entities($hosts)."</td>\n";
-       my %osstestrevs;
-       $osstestverq->execute($r->{Flight}{flight});
-       while (my ($harness) = $osstestverq->fetchrow_array()) {
-           $osstestrevs{$harness}++;
-       }
+       my $osstestrevmap = cacheable_fn($r->{Flight}, 'o', sub {
+            my %osstestrevs;
+           $osstestverq->execute($r->{Flight}{flight});
+           while (my ($harness) = $osstestverq->fetchrow_array()) {
+               $osstestrevs{$harness}++;
+           }
+           \%osstestrevs;
+       });
        my $osstestrevs = join ' ',
             map {
                s/^([0-9a-f]{12})[0-9a-f]+\b/$1/;
                "<kbd>".encode_entities($_)."</kbd>";
             }
-            sort keys %osstestrevs;
+            sort keys %$osstestrevmap;
        my $osstest_colour = report_altchangecolour(\$alt_osstest, 
$osstestrevs);
        print H "<td $osstest_colour>$osstestrevs</td>\n";
        foreach my $i (0..$#rev_grid_cols) {
-- 
2.11.0




 


Rackspace

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