Commit e860c36
Merge #153383
153383: roachtest: fix division by zero in metric aggregation functions r=shailendra-patel a=shailendra-patel
Add safety checks to prevent division by zero and handle empty data in metric processing:
- Skip summaries with TotalElapsed=0 in `DefaultProcessFunction`.
- Return error for empty histogram summaries in `restoreAggregateFunction`.
- Only calculate mean when totalMeanCount > 0 in `tpchbench` aggregation.
These changes prevent runtime panics when processing metrics with missing or invalid data.
The changes were initially introduced in #138617
Epic: none
Release note: None
Co-authored-by: Shailendra Patel <shailendra.patel@cockroachlabs.com>File tree
3 files changed
+10
-0
lines changed- pkg/cmd/roachtest
- registry
- tests
3 files changed
+10
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
32 | 35 | | |
33 | 36 | | |
34 | 37 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
45 | 49 | | |
46 | 50 | | |
47 | 51 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
135 | 135 | | |
136 | 136 | | |
137 | 137 | | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
138 | 141 | | |
139 | 142 | | |
140 | 143 | | |
| |||
0 commit comments