Stop the source-fact drilldown fanning out per pinned value
The <value> path segment is client-supplied and reached a full unfiltered /facts fan-out, keyed per value, so every distinct value was a fresh whole-estate query and a fresh cache entry. - validate <value> against the configured backend names, answering [] with no fan-out when it names none - key the drilldown's fetch on the fact name alone and apply <value> to the shared record set, so all values share one entry and one fan-out - report every configured backend on the no-fan-out empty response, which is complete rather than partial
This commit is contained in:
@@ -96,6 +96,18 @@ func (cb *countingBackend) hitCount(path string) int {
|
||||
return cb.hits[path]
|
||||
}
|
||||
|
||||
// totalHits counts requests across every path, so a test can assert a route
|
||||
// reached no backend at all.
|
||||
func (cb *countingBackend) totalHits() int {
|
||||
cb.mu.Lock()
|
||||
defer cb.mu.Unlock()
|
||||
n := 0
|
||||
for _, c := range cb.hits {
|
||||
n += c
|
||||
}
|
||||
return n
|
||||
}
|
||||
|
||||
func (cb *countingBackend) setFail(v bool) {
|
||||
cb.mu.Lock()
|
||||
defer cb.mu.Unlock()
|
||||
|
||||
Reference in New Issue
Block a user