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

Method minTime

pkg/querier/tripperware/merge.go:25–38  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

23func (a byFirstTime) Less(i, j int) bool { return a[i].minTime() < a[j].minTime() }
24
25func (resp *PrometheusResponse) minTime() int64 {
26 data := resp.GetData()
27 res := data.GetResult()
28 // minTime should only be called when the response is fron range query.
29 matrix := res.GetMatrix()
30 sampleStreams := matrix.GetSampleStreams()
31 if len(sampleStreams) == 0 {
32 return -1
33 }
34 if len(sampleStreams[0].Samples) == 0 {
35 return -1
36 }
37 return sampleStreams[0].Samples[0].TimestampMs
38}
39
40// MergeResponse merges multiple Response into one.
41func MergeResponse(ctx context.Context, sumStats bool, req Request, responses ...Response) (Response, error) {

Callers 1

LessMethod · 0.45

Calls 4

GetDataMethod · 0.95
GetMatrixMethod · 0.80
GetSampleStreamsMethod · 0.80
GetResultMethod · 0.45

Tested by

no test coverage detected