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

[OSSTEST PATCH 52/60] sg-report-job-history: Cache the per-flight revisions


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
  • Date: Fri, 14 Aug 2020 18:21:57 +0100
  • Authentication-results: esa2.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:36 +0000
  • Ironport-sdr: yMkTEtTkwa6Z7Zl0aTNzX97qii72UIAqi31sn8bj30x1CXvyvZJyQnGo3ygB0kQm23ueBsl2Ao X/HU9lATQLMrkbqxH2bQI1fGbKW8cZIujYo5+J7eFXbFXOU7YiF7cBpCtj7rjJJGdWE5gKJ1Yc SlU47uDFYStfbpZKjx/EQIqbAiSOzlqPstrxQ5b9Nb4d6cK5VLu4rjr9/l7hftTAmHST1piljH L9o/VlEtXUQFNWzNjl0VFXg2ayMTdEDO6vuTyfikLahoYg1R7mPmqpnWsd8jEBpRdaSffPiAk6 J3Y=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

This involves changing %revisions to %$revisions in the code which
uses the value.

No logical change.

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

diff --git a/sg-report-job-history b/sg-report-job-history
index 9f1216a6..39ebe024 100755
--- a/sg-report-job-history
+++ b/sg-report-job-history
@@ -172,25 +172,29 @@ END
            \%hosts;
        });
 
-        my %revisions;
-        add_revisions(\%revisions, $f->{flight}, $f->{job}, '');
+       my $revisions = cacheable_fn($f, 'r', sub {
+            my %revisions;
+           add_revisions(\%revisions, $f->{flight}, $f->{job}, '');
         
-        $buildsq->execute($f->{flight}, $f->{job});
-        while (my $bld= $buildsq->fetchrow_hashref()) {
-            my $bn= $bld->{name};
-            $bn =~ s/buildjob$//;
-            my ($oflight,$ojob) = flight_otherjob($f->{flight}, $bld->{val});
-            add_revisions(\%revisions, $oflight, $ojob, " ($bn)");
-        }
+           $buildsq->execute($f->{flight}, $f->{job});
+           while (my $bld= $buildsq->fetchrow_hashref()) {
+               my $bn= $bld->{name};
+               $bn =~ s/buildjob$//;
+               my ($oflight,$ojob) =
+                 flight_otherjob($f->{flight}, $bld->{val});
+               add_revisions(\%revisions, $oflight, $ojob, " ($bn)");
+           }
+           \%revisions;
+       });
         my @rev_cols;
-        foreach my $revk (sort keys %revisions) {
+        foreach my $revk (sort keys %$revisions) {
             my $col= $rev_grid_col{$revk};
             if (!defined $col) {
                 $col= @rev_grid_cols;
                 push @rev_grid_cols, $revk;
                 $rev_grid_col{$revk}= $col;
             }
-            $rev_cols[$col]= $revisions{$revk};
+            $rev_cols[$col]= $$revisions{$revk};
         }
         $ri->{Revisions}= \@rev_cols;
         $ri->{Flight}= $f;
-- 
2.11.0




 


Rackspace

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