MCPcopy
hub / github.com/uber/aresdb / applyStageStats

Method applyStageStats

query/stats.go:188–198  ·  view source on GitHub ↗

applyStageStats applies the stage stats to the overall query stats and compute max,minCallName and total for that stage.

(name stageName, value float64)

Source from the content-addressed store, hash-verified

186// applyStageStats applies the stage stats to the overall query stats and compute max,minCallName and total for that
187// stage.
188func (stats *oopkQueryStats) applyStageStats(name stageName, value float64) {
189 if _, ok := stats.Name2Stage[name]; !ok {
190 stats.Name2Stage[name] = &oopkStageSummaryStats{name: name, max: -1, min: math.MaxFloat64}
191 }
192 stageStats := stats.Name2Stage[name]
193 stageStats.max = math.Max(stageStats.max, value)
194 stageStats.min = math.Min(stageStats.max, value)
195 stageStats.count++
196 stageStats.total += value
197 stats.TotalTiming += value
198}
199
200// applyBatchStats applies the current batch stats onto the overall query stats. It computes information
201// like max, minCallName, average for each stage as well as the percentage.

Callers 2

applyBatchStatsMethod · 0.95
reportTimingMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected