MCPcopy Create free account
hub / github.com/cortexproject/cortex / Merge

Method Merge

pkg/querier/stats/stats.go:382–399  ·  view source on GitHub ↗

Merge the provided Stats into this one.

(other *QueryStats)

Source from the content-addressed store, hash-verified

380
381// Merge the provided Stats into this one.
382func (s *QueryStats) Merge(other *QueryStats) {
383 if s == nil || other == nil {
384 return
385 }
386
387 s.AddWallTime(other.LoadWallTime())
388 s.AddQueryStorageWallTime(other.LoadQueryStorageWallTime())
389 s.AddFetchedSeries(other.LoadFetchedSeries())
390 s.AddFetchedChunkBytes(other.LoadFetchedChunkBytes())
391 s.AddFetchedDataBytes(other.LoadFetchedDataBytes())
392 s.AddFetchedSamples(other.LoadFetchedSamples())
393 s.AddFetchedChunks(other.LoadFetchedChunks())
394 s.AddStoreGatewayTouchedPostings(other.LoadStoreGatewayTouchedPostings())
395 s.AddStoreGatewayTouchedPostingBytes(other.LoadStoreGatewayTouchedPostingBytes())
396 s.AddScannedSamples(other.LoadScannedSamples())
397 s.SetPeakSamples(max(s.LoadPeakSamples(), other.LoadPeakSamples()))
398 s.AddExtraFields(other.LoadExtraFields()...)
399}
400
401func ShouldTrackHTTPGRPCResponse(r *httpgrpc.HTTPResponse) bool {
402 // Do no track statistics for requests failed because of a server error.

Callers 3

fetchSeriesFromStoresMethod · 0.95
TestStats_MergeFunction · 0.95
CopyMethod · 0.95

Calls 15

AddWallTimeMethod · 0.95
AddFetchedSeriesMethod · 0.95
AddFetchedChunkBytesMethod · 0.95
AddFetchedDataBytesMethod · 0.95
AddFetchedSamplesMethod · 0.95
AddFetchedChunksMethod · 0.95
AddScannedSamplesMethod · 0.95
SetPeakSamplesMethod · 0.95
LoadPeakSamplesMethod · 0.95

Tested by 1

TestStats_MergeFunction · 0.76