Repository navigation
Commit 1bca29c
feat(query-engine): log precompute ingest throughput (#716)
* feat(query-engine): log precompute ingest throughput
samples_ingested was an AtomicU64 incremented on every HTTP ingest
request but never read. Spawn a self-contained 30s ticker inside
HttpIngestSource::run that swaps it to 0 each tick and logs the
resulting samples/sec at debug level, so ingest throughput shows up
in query_engine.log for any run with debug logging enabled.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PR8ENqodwuB1o8k4YAcjcJ
* fix(query-engine): stop ingest throughput ticker leaking on source exit
roborev (job 196) on fef024e: the diagnostics ticker was spawned
before TcpListener::bind, so a bind failure left it running forever,
holding the HttpIngestState alive and logging 0 samples/sec
indefinitely. Bind first, then spawn the ticker only on success, and
abort it once axum::serve(...) resolves (success or error) so it
never outlives the ingest server.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PR8ENqodwuB1o8k4YAcjcJ
* fix(query-engine): abort ingest ticker on cancellation, not just on exit
roborev (job 199) on e937288: ticker.abort() only ran on axum::serve
returning, so if run()'s own future were ever dropped/cancelled
mid-await by a future caller, the abort call would never execute — a
bare JoinHandle detaches rather than cancels its task on drop. Wrap
the ticker's JoinHandle in a small AbortOnDrop guard so it's aborted
on every exit path, including cancellation, and add a regression test
that proves drop actually cancels the wrapped task.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PR8ENqodwuB1o8k4YAcjcJ
* fix(query-engine): make abort-on-drop test actually falsifiable
roborev (job 200) on d90a0a7: the regression test checked a flag set
after a 60s sleep, but only waited 50ms before asserting — so it
passed even with AbortOnDrop::drop() doing nothing, since 50ms never
approaches 60s either way. Confirmed by temporarily neutering the
abort call: the old test still passed.
Rewrote it to check ongoing progress instead: the wrapped task
increments a counter on a 5ms cadence, the test waits for it to start,
drops the guard, then asserts the counter stops advancing. Verified
this version fails without the real abort call and passes with it.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PR8ENqodwuB1o8k4YAcjcJ
* fix(query-engine): measure real elapsed time for ingest throughput rate
The deferred Low finding from roborev job 196: tokio::time::interval
defaults to MissedTickBehavior::Burst, and the rate always divided by
the fixed INGEST_DIAG_INTERVAL constant rather than actual elapsed
time. Under a runtime stall this would replay missed ticks back to
back, each still claiming the fixed 30s window and misreporting the
rate. Track Instant::now() across ticks and divide by measured
elapsed time instead, and set MissedTickBehavior::Delay so a stall
produces one accurately-labeled longer interval rather than a burst of
catch-up ticks.
Verified via a shortened-interval smoke test against test_e2e_precompute:
elapsed time and rate match the raw sample count under normal operation.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PR8ENqodwuB1o8k4YAcjcJ
---------
Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>1 parent 3f4f83c commit 1bca29c
1 file changed
Lines changed: 106 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
10 | 12 | | |
11 | 13 | | |
12 | 14 | | |
| |||
33 | 35 | | |
34 | 36 | | |
35 | 37 | | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
36 | 50 | | |
37 | 51 | | |
38 | 52 | | |
39 | 53 | | |
40 | 54 | | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | 55 | | |
46 | 56 | | |
47 | 57 | | |
| |||
53 | 63 | | |
54 | 64 | | |
55 | 65 | | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
56 | 104 | | |
57 | 105 | | |
58 | 106 | | |
| |||
100 | 148 | | |
101 | 149 | | |
102 | 150 | | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
0 commit comments