diff mbox series

[OSSTEST,12/60] history reporting (nfc): Record query-specific stats

Message ID 20200814172205.9624-13-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 | 6 ++++++
 1 file changed, 6 insertions(+)
diff mbox series

Patch

diff --git a/sg-report-host-history b/sg-report-host-history
index 705367cf..32414322 100755
--- a/sg-report-host-history
+++ b/sg-report-host-history
@@ -77,6 +77,10 @@  our $flightcond;
 our $minflight;
 
 our %cache;
+
+our %q_count;
+our %q_misses;
+
 our @cache_row_key_cols = qw(flight job status name);
 
 sub cache_row_key ($) {
@@ -186,8 +190,10 @@  sub cacheable_fn ($$$) {
     $jqtotal++;
     $cachekey = '%'.$cachekey;
     my $cached = $jr->{$cachekey};
+    $q_count{$cachekey}++;
     if (!$cached) {
 	$jqcachemisses++;
+	$q_misses{$cachekey}++;
 	$cached = $fn->();
 	$jr->{$cachekey} = $cached;
     }