Commit 3f607ea
committed
perf(router): sweep output-token deltas once per print interval
Move the per-running-req shm_cur_output_len delta tracking from the
router tick (~33 Hz) into SystemStatusReporter.maybe_print, which only
runs once per log_stats_interval (>= 5s). The reporter now owns the
per-req snapshot dict and exposes discard_req(req) for tail settlement
when a req leaves the running batch, so the router loop's hot path no
longer walks the batch every schedule cycle. Output TPS accuracy is
unchanged: still based on real shm_cur_output_len deltas, with tail
tokens settled at completion.1 parent 7c69bfc commit 3f607ea
2 files changed
Lines changed: 31 additions & 25 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | 70 | | |
74 | 71 | | |
75 | 72 | | |
| |||
249 | 246 | | |
250 | 247 | | |
251 | 248 | | |
252 | | - | |
253 | | - | |
254 | | - | |
255 | | - | |
256 | | - | |
257 | | - | |
258 | | - | |
259 | | - | |
260 | | - | |
261 | | - | |
262 | | - | |
263 | | - | |
| 249 | + | |
| 250 | + | |
264 | 251 | | |
265 | 252 | | |
266 | 253 | | |
| |||
357 | 344 | | |
358 | 345 | | |
359 | 346 | | |
360 | | - | |
361 | | - | |
362 | | - | |
363 | | - | |
364 | | - | |
365 | | - | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
366 | 350 | | |
367 | 351 | | |
368 | 352 | | |
369 | 353 | | |
370 | 354 | | |
371 | 355 | | |
372 | | - | |
| 356 | + | |
373 | 357 | | |
374 | 358 | | |
375 | 359 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| |||
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
34 | 39 | | |
35 | 40 | | |
36 | 41 | | |
37 | 42 | | |
38 | | - | |
39 | | - | |
40 | | - | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
41 | 52 | | |
42 | 53 | | |
43 | 54 | | |
| |||
64 | 75 | | |
65 | 76 | | |
66 | 77 | | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
67 | 89 | | |
68 | 90 | | |
69 | 91 | | |
| |||
0 commit comments