Skip to content

Commit 49db770

Browse files
committed
Deduplicate aggregated query cache hit counts
1 parent e6a73cb commit 49db770

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

analyzeme/src/analysis.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,8 +272,11 @@ impl ProfilingData {
272272
// Aggregated query cache hit counts
273273
QUERY_CACHE_HIT_COUNT_EVENT_KIND => {
274274
record_event_data(&current_event.label, &|data| {
275-
assert_eq!(data.number_of_cache_hits, 0);
276-
data.number_of_cache_hits = value as usize;
275+
// rustc produces aggregated cache hits per **query invocation**,
276+
// so a query + specific instances of arguments.
277+
// We need to deduplicate the aggregated counts here to sum them up
278+
// for individual queries, according to the event label.
279+
data.number_of_cache_hits += value as usize;
277280
});
278281
query_cache_hit_counts_found.insert(current_event.label.into_owned());
279282
}

0 commit comments

Comments
 (0)