MCPcopy Index your code
hub / github.com/prometheus/prometheus / SamplesReadPerStepMap

Method SamplesReadPerStepMap

util/stats/query_stats.go:184–194  ·  view source on GitHub ↗

SamplesReadPerStepMap returns the per-step samples read as a map (timestamp -> count), or nil if per-step stats are disabled.

()

Source from the content-addressed store, hash-verified

182// SamplesReadPerStepMap returns the per-step samples read as a map
183// (timestamp -> count), or nil if per-step stats are disabled.
184func (qs *QuerySamples) SamplesReadPerStepMap() *TotalSamplesPerStep {
185 if !qs.EnablePerStepStats || qs.SamplesReadPerStep == nil {
186 return nil
187 }
188
189 ts := TotalSamplesPerStep{}
190 for _, s := range qs.samplesReadPerStepPoints() {
191 ts[s.T] = int(s.V)
192 }
193 return &ts
194}
195
196func (qs *QuerySamples) totalSamplesPerStepPoints() []stepStat {
197 if !qs.EnablePerStepStats {

Callers 1

TestQueryStatisticsFunction · 0.80

Calls 1

Tested by 1

TestQueryStatisticsFunction · 0.64