Commit 01483d5
authored
fix: update and extend async event delivery time metrics tests for JobParameters logic (#5975)
# Description
This PR updates both the source code and tests related to async event
delivery time metrics in the batch router, specifically for the
`emitAsyncEventDeliveryTimeMetrics` logic.
**Source code changes:**
- Refactored `emitAsyncEventDeliveryTimeMetrics` to prefer extracting
metric parameters from `JobParameters` on the `JobStatusT` struct, with
a fallback to `OriginalJobParameters` if `JobParameters` is missing or
invalid.
- Improved error logging and robustness when job parameters are missing
or malformed.
**Test changes:**
- Updated all relevant tests to set `JobParameters` on `JobStatusT` to
match the value in `OriginalJobParameters`, ensuring the new primary
path is exercised.
- Added a new test to verify fallback logic when `JobParameters` is
empty, confirming that metrics are still emitted using
`OriginalJobParameters`.
- Ensured that negative and edge cases (such as missing or invalid
parameters, or no successful jobs) are still covered and use the correct
field.
- These changes ensure robust coverage for the new logic and prevent
regressions in metric emission for async destinations.
## Linear Ticket
https://linear.app/rudderstack/issue/INT-3763/rudderserver-add-event-delivery-metrics-for-async-destinations
## Security
- [x] The code changed/added as part of this pull request won't create
any security issues with how the software is being used.1 parent 6fbb5a3 commit 01483d5
2 files changed
+69
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
323 | 323 | | |
324 | 324 | | |
325 | 325 | | |
326 | | - | |
327 | 326 | | |
| 327 | + | |
328 | 328 | | |
329 | 329 | | |
330 | 330 | | |
| |||
360 | 360 | | |
361 | 361 | | |
362 | 362 | | |
363 | | - | |
364 | | - | |
365 | | - | |
| 363 | + | |
366 | 364 | | |
367 | 365 | | |
368 | 366 | | |
369 | 367 | | |
370 | 368 | | |
371 | 369 | | |
372 | 370 | | |
373 | | - | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
374 | 376 | | |
375 | 377 | | |
376 | 378 | | |
| |||
412 | 414 | | |
413 | 415 | | |
414 | 416 | | |
| 417 | + | |
415 | 418 | | |
416 | 419 | | |
417 | 420 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
284 | 284 | | |
285 | 285 | | |
286 | 286 | | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
287 | 348 | | |
288 | 349 | | |
289 | 350 | | |
| |||
0 commit comments