Commit e4ebb50
committed
fix: [#1589] use average aggregation for UDP processing time metrics
When calculating aggregated values for processing time metrics across
multiple servers, we need to use the average (.avg()) instead of sum
(.sum()) because the metric samples are already averages per server.
Using sum() on pre-averaged values would produce incorrect results,
as it would add up the averages rather than computing the true average
across all servers.
Changes:
- Add new *_averaged() methods that use .avg() for proper aggregation
- Update services.rs to use the corrected averaging methods
- Import Avg trait for metric collection averaging functionality
Fixes incorrect metric aggregation for:
- udp_avg_connect_processing_time_ns
- udp_avg_announce_processing_time_ns
- udp_avg_scrape_processing_time_ns"1 parent ba3d8a9 commit e4ebb50
2 files changed
Lines changed: 46 additions & 3 deletions
File tree
- packages
- rest-tracker-api-core/src/statistics
- udp-tracker-server/src/statistics
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
77 | | - | |
78 | | - | |
79 | | - | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| |||
215 | 216 | | |
216 | 217 | | |
217 | 218 | | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
218 | 261 | | |
219 | 262 | | |
220 | 263 | | |
| |||
0 commit comments