feat(io): add REST performance instrumentation - #178
Open
ran-yuan-rui wants to merge 4 commits into
Open
Conversation
Adds a perf_instrumentation config gate (off by default; no hot-path clock reads when off), per-request timing carriers on rest_chunked_rx_request, and a host_read_attribution tag so synchronous host reads can be told apart from async chunk reads. prep_host_rx_request gains a four-argument overload carrying the tag; the existing three-argument signature stays as a delegating overload, so no existing symbol or caller changes.
…ation Adds the REST perf-counter subsystem: a 16-field rest_perf_snapshot value struct, per-reactor relaxed atomics behind it, and a pool-level aggregation on rest_ioctx (sums, maxes, and the smallest non-zero ttfb). Retry, terminal-failure, device-stream-sync and payload-byte counters are always on; the micro timings (chunk_get, queue_wait, ttfb, h2d_observed) record only under the perf_instrumentation gate, which costs zero clock reads when off. Snapshot layout is not ABI-stable: consumers build from the same source pin, and fields are appended, never reordered or removed.
A real 127.0.0.1 HTTP/1.1 server for driving the REST reactor end to end in-process: ranged GET/206, HEAD, a single-page LIST XML mode, a controllable per-request delay, and fault injection (fail the first N requests with a configurable status). Pure POSIX + std, header-only.
Twenty cases on cucascade_io_tests locking the perf-counter contract: default/zero state and noexcept readouts, chunk vs blocking vs footer attribution, HEAD and LIST isolation from payload/chunk counters, gate on/off semantics (safety counters live with the gate off), pool aggregation across reactors, retry/terminal accounting incl. the 403 re-authorize path, device-read h2d timings with a clean-read stream-sync-zero proof, deterministic queue wait, and a stash-hit zero-movement check. Driven through the loopback range server; snapshots are read only after all futures resolve (counters are relaxed atomics).
Contributor
|
/ok to test 3eda942 |
aminaramoon
approved these changes
Aug 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Implements the REST perf-instrumentation follow-up left out of #172. Sirius consumes these counters in its S3 tests and benchmark JSON.
Add loopback HTTP range server for REST conformance tests
Counter behavior
chunk_get,queue_wait,h2d_observed,blocking_host_get, andttfb_nsare recorded only whenperf_instrumentationis enabled. The disabled instrumentation path adds no clock reads.ttfb_nsmeasures GET submission to completion of the first completed GET, not time to the first byte on the wire.rest_perf_snapshotis source-pin API rather than a stable binary layout. New fields are appended without reordering existing fields.Validation
pixi run -e cuda-12-stable build/test— 4/4 ctest targets,cucascade_io_tests103 cases / 1169 assertions green,[rest][perf]20 cases / 149 assertions.