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

Method RoundTrip

modules/frontend/pipeline/responses_test.go:410–429  ·  view source on GitHub ↗
(r Request)

Source from the content-addressed store, hash-verified

408}
409
410func (s sharder) RoundTrip(r Request) (Responses[combiner.PipelineResponse], error) {
411 total := 4
412 concurrent := 2
413
414 // execute requests
415 if s.funcSharder {
416 return NewAsyncSharderFunc(r.HTTPRequest().Context(), concurrent, total, func(_ int) Request {
417 return r
418 }, s.next), nil
419 }
420
421 reqCh := make(chan Request)
422 go func() {
423 for i := 0; i < total; i++ {
424 reqCh <- r
425 }
426 close(reqCh)
427 }()
428 return NewAsyncSharderChan(r.HTTPRequest().Context(), concurrent, reqCh, nil, s.next), nil
429}
430
431func BenchmarkNewSyncToAsyncResponse(b *testing.B) {
432 r := &http.Response{}

Callers

nothing calls this directly

Calls 4

NewAsyncSharderFuncFunction · 0.85
NewAsyncSharderChanFunction · 0.85
ContextMethod · 0.65
HTTPRequestMethod · 0.65

Tested by

no test coverage detected