applyStageStats applies the stage stats to the overall query stats and compute max,minCallName and total for that stage.
(name stageName, value float64)
| 186 | // applyStageStats applies the stage stats to the overall query stats and compute max,minCallName and total for that |
| 187 | // stage. |
| 188 | func (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. |
no outgoing calls
no test coverage detected