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

[OSSTEST PATCH 17/60] history reporting: Cache stats reporting: Centralise and rework


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
  • Date: Fri, 14 Aug 2020 18:21:22 +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:54 +0000
  • Ironport-sdr: zFNVZ/yNaBs/RwWhfhsC3hLuE+5mbJuv5+TSB6jTA/S45Ql/xDkCZYXNQDOD+Ul7Zy5325BDwD 3KQkroufcgpnS9VvdPWkQrPuzWioHFTXLZzN+tnRKTDgF8RW1TOsCKWbDOxK7061p2dAKCGB8E NV6OutNrglmz0SEUtiKRce+PaaGUThdACd7nqujpzX5GkMxAg183rUWvxb82RrHbTjqDuliYat CFsdSVI9qhvr7CL/Sw5YK1sJd7ddLMDaXB9wvMNYcCTDT8WQlF1VeSgxcQalL/opXvIfw3Mwgw JCE=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

This uses the new variables instead of the old ones.

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

diff --git a/sg-report-host-history b/sg-report-host-history
index 32cc883d..9c70b560 100755
--- a/sg-report-host-history
+++ b/sg-report-host-history
@@ -185,6 +185,17 @@ sub cache_write_entry ($$) {
     print $fh " -->\n";
 }
 
+sub cache_report_stats ($) {
+    my ($what) = @_;
+    print ::DEBUG "CACHE $what read=$rows_previous hits $rows_hit/$rows_today";
+    for my $cachekey (sort keys %q_count) {
+       my $total = $q_count{$cachekey};
+       my $hits = $total - ($q_misses{$cachekey} // 0);
+       print ::DEBUG " $cachekey=$hits/$total";
+    }
+    print ::DEBUG "\n";
+}
+
 cache_set_key_cols(qw(flight job status name));
 
 sub computeflightsrange () {
@@ -335,9 +346,6 @@ END
        push @rows, { %$jr, %$endedrow };
     }
 
-    print DEBUG "CACHE $hostname $rows_hit / ".(scalar @rows)
-       ." of ".(scalar %cache)."\n";
-
     @rows = sort { $b->{finished} <=> $a->{finished} } @rows;
 
     print DEBUG "SORTED\n";
@@ -457,8 +465,7 @@ END
     rename "$html_file.new", "$html_file" or die "$html_file $!"
         if $doinstall;
 
-    print DEBUG "HOST CACHE RQ $runvarq_hits / ".
-         ($runvarq_hits+$runvarq_misses)."\n";
+    cache_report_stats("$hostname");
 }
 
 foreach my $host (@ARGV) {
@@ -528,7 +535,6 @@ foreach my $host (sort keys %hosts) {
             mainquery($host);
            reporthost $host;
        });
-       print DEBUG "JQ CACHE ".($jqtotal-$jqcachemisses)." / $jqtotal\n";
        exit(0);
     }
     print DEBUG "SPAWNED [$pid] $host\n";
-- 
2.11.0




 


Rackspace

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