diff mbox series

[OSSTEST,16/60] history reporting (nfc): Record more row-specific stats

Message ID 20200814172205.9624-17-ian.jackson@eu.citrix.com (mailing list archive)
State New, archived
Headers show
Series Speed up sg-report-job-history | expand

Commit Message

Ian Jackson Aug. 14, 2020, 5:21 p.m. UTC
Prep work.  Nothing uses these yet.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 sg-report-host-history | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/sg-report-host-history b/sg-report-host-history
index 07e549a0..32cc883d 100755
--- a/sg-report-host-history
+++ b/sg-report-host-history
@@ -83,6 +83,10 @@  our %cache;
 our %q_count;
 our %q_misses;
 
+our $rows_previous = 0;
+our $rows_today = 0;
+our $rows_hit = 0;
+
 sub cache_set_key_cols { @cache_row_key_cols = @_; }
 
 sub cache_row_key ($) {
@@ -128,6 +132,7 @@  sub cache_read_previous ($) {
     }
     %cache = ();
     for (;;) {
+	$rows_previous++;
         $_ = <H> // last;
         next unless m{^\<\!-- osstest-report-reuseable (.*)--\>$};
 	my $jr = {};
@@ -151,6 +156,7 @@  sub cache_read_previous ($) {
 sub cache_row_lookup_prep ($) {
     my ($jrr) = @_;
 
+    $rows_today++;
     my $cacherow = $cache{cache_row_key($$jrr)};
     if ($cacherow) {
 	$$jrr = $cacherow;
@@ -313,7 +319,6 @@  END
     # The contents of $jr for each job is cached across runs.
 
     my @rows;
-    my $rows_hit = 0;
     foreach my $jr (@$inrows) {
 	#print DEBUG "JOB $jr->{flight}.$jr->{job} ";