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

[OSSTEST PATCH 01/60] history reporting (nfc): Do not key cache on hostname any more


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
  • Date: Fri, 14 Aug 2020 18:21:06 +0100
  • Authentication-results: esa1.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:22:20 +0000
  • Ironport-sdr: ONtIFVyXJwkCpDNFv43eVx5sFrmhe57dsGwVmo3cuMWhLTNHKS8SlVvhyewcYHDHV4iZaBObwY vOWuIi5UQbmECw0soiEYJ1dZYFlHVVhGNwYG7BhHuVXjWEZHZ/k9GrTLpK17hTTFkQnsBrmsHi HGwyGw6bxn5M/EXEhdGUyO2QiydwC8e+B/T73qLw0KJe8EHJrrZ9UUtfrPJf/WsaSBFX8nlO77 ptbTv70h5jmjOutwcY53VFfDGfULOTnysQwmeZ3aS0l029RIKr3kZfpLCBCfPw8TmaFPoWogLK iEM=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Now we process only one host at a time, so we don't need to
distinguish.

Replace all references to $tcache with %cache.

Signed-off-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
---
 sg-report-host-history | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/sg-report-host-history b/sg-report-host-history
index 380f8fac..50cc5b58 100755
--- a/sg-report-host-history
+++ b/sg-report-host-history
@@ -76,7 +76,7 @@ our $restrictflight_cond = restrictflight_cond();
 our $flightcond;
 our $minflight;
 
-our %hcaches;
+our %cache;
 
 sub read_existing_logs ($) {
     my ($hostname) = @_;
@@ -86,8 +86,7 @@ sub read_existing_logs ($) {
         return if $!==ENOENT;
         die "failed to open $html_file: $!";
     }
-    my $tcache = { };
-    $hcaches{$hostname} = $tcache;
+    %cache = ();
     for (;;) {
         $_ = <H> // last;
         next unless m{^\<\!-- osstest-report-reuseable (.*)--\>$};
@@ -106,7 +105,7 @@ sub read_existing_logs ($) {
 #          print DEBUG "GOTCACHE $hostname $k\n";
        }
 #      print DEBUG "GOTCACHE $hostname \@ $jr->{flight} $jr->{job} 
$jr->{status},$jr->{name}\n";
-       $tcache->{$jr->{flight},$jr->{job},$jr->{status},$jr->{name}} = $jr;
+       $cache{$jr->{flight},$jr->{job},$jr->{status},$jr->{name}} = $jr;
     }
     close H;
 }
@@ -253,8 +252,6 @@ END
     my $inrows = $hosts{$hostname};
     print DEBUG "FOUND ", (scalar @$inrows), " ROWS for $hostname\n";
 
-    my $tcache = $hcaches{$hostname};
-
     # Each entry in @$inrows is a $jr, which is a hash
     # It has keys for the result columns in mainquery
     # It also has keys '%<letter>' (yes, with a literal '%')
@@ -267,7 +264,7 @@ END
        #print DEBUG "JOB $jr->{flight}.$jr->{job} ";
 
        my $cacherow =
-           $tcache->{$jr->{flight},$jr->{job},$jr->{status},$jr->{name}};
+           $cache{$jr->{flight},$jr->{job},$jr->{status},$jr->{name}};
        if ($cacherow) {
            $jr = $cacherow;
            $cachehits++;
@@ -285,7 +282,7 @@ END
     }
 
     print DEBUG "CACHE $hostname $cachehits / ".(scalar @rows)
-       ." of ".(scalar %$tcache)."\n";
+       ." of ".(scalar %cache)."\n";
 
     my $write_cache_entry = sub {
        my ($jr) = @_;
-- 
2.11.0




 


Rackspace

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