Commit e41a572
Timothy Dodd
Improve batching, logging, and duplicate handling
Enhanced `BatchingService` and `LogController` to improve scalability, robustness, and clarity:
- Added throttling for drop warnings to reduce log spam.
- Optimized queue size enforcement by dropping 10% of the queue at capacity.
- Handled HTTP 206 responses as successful in `SendBatchWithRetryAsync`.
- Differentiated between client (4xx) and server (5xx) errors; client errors no longer trigger retries.
- Increased default batch size, queue size, and batch rate limits in `BatchingOptions` and `appsettings.json`.
- Improved duplicate log handling in `Create`:
- Counted duplicates separately and excluded them from validation errors.
- Adjusted batch status and HTTP responses to treat duplicates as expected behavior.
- Enhanced logging and metrics:
- Logged duplicate counts at debug level.
- Summarized validation errors and limited detailed logs to the first five.
- Updated metrics to exclude duplicates from validation error counts.
These changes optimize performance, reduce unnecessary retries, and provide clearer insights into system behavior.1 parent 684333c commit e41a572
3 files changed
Lines changed: 74 additions & 26 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
53 | 57 | | |
54 | 58 | | |
55 | 59 | | |
| |||
107 | 111 | | |
108 | 112 | | |
109 | 113 | | |
110 | | - | |
| 114 | + | |
111 | 115 | | |
112 | 116 | | |
| 117 | + | |
113 | 118 | | |
114 | | - | |
| 119 | + | |
115 | 120 | | |
116 | 121 | | |
117 | 122 | | |
118 | 123 | | |
119 | | - | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
120 | 134 | | |
121 | 135 | | |
122 | 136 | | |
| |||
423 | 437 | | |
424 | 438 | | |
425 | 439 | | |
426 | | - | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
427 | 443 | | |
| 444 | + | |
428 | 445 | | |
429 | 446 | | |
430 | 447 | | |
431 | 448 | | |
432 | 449 | | |
433 | | - | |
| 450 | + | |
434 | 451 | | |
435 | 452 | | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
436 | 463 | | |
437 | 464 | | |
| 465 | + | |
438 | 466 | | |
439 | | - | |
| 467 | + | |
440 | 468 | | |
441 | 469 | | |
442 | 470 | | |
| |||
575 | 603 | | |
576 | 604 | | |
577 | 605 | | |
578 | | - | |
| 606 | + | |
579 | 607 | | |
580 | | - | |
| 608 | + | |
581 | 609 | | |
582 | 610 | | |
583 | 611 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
33 | | - | |
34 | | - | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
35 | 36 | | |
36 | 37 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
| 97 | + | |
97 | 98 | | |
98 | 99 | | |
99 | 100 | | |
| |||
111 | 112 | | |
112 | 113 | | |
113 | 114 | | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
114 | 123 | | |
115 | 124 | | |
116 | 125 | | |
| |||
214 | 223 | | |
215 | 224 | | |
216 | 225 | | |
217 | | - | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
218 | 233 | | |
219 | 234 | | |
220 | 235 | | |
| |||
225 | 240 | | |
226 | 241 | | |
227 | 242 | | |
228 | | - | |
| 243 | + | |
229 | 244 | | |
230 | 245 | | |
231 | 246 | | |
| |||
235 | 250 | | |
236 | 251 | | |
237 | 252 | | |
238 | | - | |
| 253 | + | |
239 | 254 | | |
240 | 255 | | |
241 | 256 | | |
| |||
255 | 270 | | |
256 | 271 | | |
257 | 272 | | |
258 | | - | |
| 273 | + | |
259 | 274 | | |
260 | 275 | | |
261 | 276 | | |
| |||
270 | 285 | | |
271 | 286 | | |
272 | 287 | | |
273 | | - | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
274 | 292 | | |
275 | | - | |
| 293 | + | |
276 | 294 | | |
277 | 295 | | |
278 | | - | |
| 296 | + | |
279 | 297 | | |
280 | | - | |
281 | | - | |
| 298 | + | |
| 299 | + | |
282 | 300 | | |
283 | 301 | | |
284 | 302 | | |
285 | | - | |
| 303 | + | |
286 | 304 | | |
287 | 305 | | |
288 | 306 | | |
| |||
405 | 423 | | |
406 | 424 | | |
407 | 425 | | |
408 | | - | |
| 426 | + | |
409 | 427 | | |
410 | | - | |
| 428 | + | |
| 429 | + | |
411 | 430 | | |
412 | | - | |
413 | | - | |
414 | | - | |
| 431 | + | |
415 | 432 | | |
| 433 | + | |
| 434 | + | |
416 | 435 | | |
417 | 436 | | |
418 | 437 | | |
| |||
0 commit comments