MCPcopy
hub / github.com/grafana/tempo / cacheResponsesEqual

Function cacheResponsesEqual

modules/frontend/search_handlers_test.go:664–679  ·  modules/frontend/search_handlers_test.go::cacheResponsesEqual
(t *testing.T, cacheResponse *tempopb.SearchResponse, pipelineResp *tempopb.SearchResponse)

Source from the content-addressed store, hash-verified

662}
663
664func cacheResponsesEqual(t *testing.T, cacheResponse *tempopb.SearchResponse, pipelineResp *tempopb.SearchResponse) {
665 // zeroing these out b/c they are set by the sharder and won't be in cache
666 pipelineResp.Metrics.TotalJobs = 0
667 pipelineResp.Metrics.CompletedJobs = 0
668 pipelineResp.Metrics.TotalBlockBytes = 0
669 pipelineResp.Metrics.TotalBlocks = 0
670
671 // cache won't have "root span not yet received" text
672 for _, tr := range pipelineResp.Traces {
673 if tr.RootServiceName == search.RootSpanNotYetReceivedText {
674 tr.RootServiceName = ""
675 }
676 }
677
678 require.Equal(t, pipelineResp, cacheResponse)
679}
680
681func TestSearchCachedMetrics(t *testing.T) {
682 // set up backend

Callers 1

TestSearchAccessesCacheFunction · 0.85

Calls 1

EqualMethod · 0.45

Tested by

no test coverage detected