Commit 388ebf7
committed
roachtest: fix division by zero in metric aggregation functions
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: None1 parent e582e3c commit 388ebf7
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 | |
|---|---|---|---|
| |||
134 | 134 | | |
135 | 135 | | |
136 | 136 | | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
137 | 140 | | |
138 | 141 | | |
139 | 142 | | |
| |||
0 commit comments