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

Function TestBuildBackendRequests

modules/frontend/search_sharder_test.go:103–259  ·  view source on GitHub ↗

nolint:all deprecated

(t *testing.T)

Source from the content-addressed store, hash-verified

101//nolint:all deprecated
102
103func TestBuildBackendRequests(t *testing.T) {
104 tests := []struct {
105 targetBytesPerRequest int
106 metas []*backend.BlockMeta
107 expectedURIs []string
108 }{
109 {
110 expectedURIs: []string{},
111 },
112 // block with no size
113 {
114 metas: []*backend.BlockMeta{
115 {
116 BlockID: backend.MustParse("00000000-0000-0000-0000-000000000000"),
117 },
118 },
119 expectedURIs: []string{},
120 },
121 // block with no records
122 {
123 metas: []*backend.BlockMeta{
124 {
125 Size_: 1000,
126 BlockID: backend.MustParse("00000000-0000-0000-0000-000000000000"),
127 },
128 },
129 expectedURIs: []string{},
130 },
131 // meta.json fields
132 {
133 targetBytesPerRequest: 1000,
134 metas: []*backend.BlockMeta{
135 {
136 Size_: 1000,
137 TotalRecords: 100,
138 BlockID: backend.MustParse("00000000-0000-0000-0000-000000000000"),
139 IndexPageSize: 13,
140 Version: "glarg",
141 },
142 },
143 expectedURIs: []string{
144 "/querier?blockID=00000000-0000-0000-0000-000000000000&encoding=none&end=20&footerSize=0&indexPageSize=13&pagesToSearch=100&size=1000&spss=3&start=10&startPage=0&totalRecords=100&version=glarg",
145 },
146 },
147 // meta.json with dedicated columns
148 {
149 targetBytesPerRequest: 1000,
150 metas: []*backend.BlockMeta{
151 {
152 Size_: 1000,
153 TotalRecords: 10,
154 BlockID: backend.MustParse("00000000-0000-0000-0000-000000000000"),
155 IndexPageSize: 13,
156 Version: "vParquet3",
157 DedicatedColumns: backend.DedicatedColumns{
158 {Scope: "span", Name: "net.sock.host.addr", Type: "string"},
159 },
160 },

Callers

nothing calls this directly

Calls 7

MustParseFunction · 0.92
ParseSearchRequestFunction · 0.92
NewHTTPRequestFunction · 0.92
backendJobsFuncFunction · 0.85
buildBackendRequestsFunction · 0.85
urisEqualFunction · 0.85
HTTPRequestMethod · 0.65

Tested by

no test coverage detected