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

[Xen-devel] [OSSTEST PATCH 12/13] sg-report-host-history: Cache runvar queries (power information)


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
  • Date: Fri, 8 Nov 2019 18:50:00 +0000
  • Authentication-results: esa3.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:47 +0000
  • Ironport-sdr: NC6aOfaSshiR4xICS+9IzE0Zym+lzhhlFoIewgreZ2U+DHkVWlvdruz7Xj+xkY61LqpeV4UfEa UB+1w6aJpcR4en2kn5DsUGJR+AG6edZQ6qyODv1ellu0ixDFsAmLuyWayjA2D6NF961iUUG6hm HapkjaydCq+ysJJQdGJcBBl6XgezJz4ijio2y1SeRx9tmCcBf+3OqTTF7HUdhsh8KV69rHHKTs OpHODVC2pOsZSeJ/XEssCNvHWh4koVq28RIoi57RtfTQ7PQss37OsR9AydJ998uhcQ5wr7vYc1 QFU=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

This per-job processing was not done with jobquery, so was not cached.
We assign it the cache letter `p'.

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

diff --git a/sg-report-host-history b/sg-report-host-history
index 7c2116d3..a11b00a0 100755
--- a/sg-report-host-history
+++ b/sg-report-host-history
@@ -322,6 +322,9 @@ END
 
     my $alternate = 0;
     my $wrote = 0;
+    my $runvarq_hits = 0;
+    my $runvarq_misses = 0;
+
     foreach my $jr (@rows) {
        if ($wrote++ >= $limit) {
            $write_cache_entry->($jr);
@@ -372,7 +375,11 @@ END
        print H "<td $ri->{ColourAttr}>$ri->{Content}</td>\n";
 
        my %powers;
-       do {
+       if ($jr->{'%p'}) {
+           %powers = %{ $jr->{'%p'} };
+           $runvarq_hits++;
+       } else {
+           $runvarq_misses++;
            $jrunvarq->execute($jr->{flight}, $jr->{job}, $ident);
            my %runvars;
            while (my ($n, $v) = $jrunvarq->fetchrow_array()) {
@@ -383,7 +390,8 @@ END
                next unless $r =~ m{^\Q${ident}\E_power_};
                $powers{$'} = $runvars{$r};
            }
-       };
+           $jr->{'%p'} = { %powers };
+       }
        my $skipped = 0;
         my $any_power = 0;
         my $pr_power_colour = sub {
@@ -429,6 +437,9 @@ END
     close H or die $!;
     rename "$html_file.new", "$html_file" or die "$html_file $!"
         if $doinstall;
+
+    print DEBUG "HOST CACHE RQ $runvarq_hits / ".
+         ($runvarq_hits+$runvarq_misses)."\n";
 }
 
 foreach my $host (@ARGV) {
-- 
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®.