Add optional [LAT] latency-profiling log points - #46
Conversation
⏱️ Full-loop Latency Benchmark (commit
|
| Phase | mean | p50 | p99 | max |
|---|---|---|---|---|
| 1. Collect indication data | 0.10 | 0.11 | 0.28 | 1.28 |
| 2. Create & encode indication | 0.52 | 0.45 | 1.22 | 13.34 |
| 3. Deliver indication (RAN -> dApp) | 81.48 | 75.28 | 142.93 | 153.04 |
| 4. Decode indication | 0.31 | 0.25 | 0.94 | 8.73 |
| 5. Process data | 0.02 | 0.02 | 0.03 | 0.13 |
| 6. Create & encode control | 0.22 | 0.17 | 0.60 | 2.81 |
| 7. Deliver control (dApp -> RAN) | 90.17 | 85.82 | 152.12 | 163.68 |
| 8. Decode & handle control | 0.29 | 0.24 | 0.95 | 10.93 |
| Total round-trip | 173.11 | 134.66 | 252.68 | 274.21 |
Benchmarked on
ubuntu-latest, Release build, ZMQ + IPC, ASN.1 APER.
🔄 E2E dApp Integration Results (commit
|
🔀 E2E Topologies — multi-dApp / multi-RAN (commit
|
Compile-gated log markers on the E3 send/receive/dispatch boundaries so the end-to-end critical path can be measured offline from interleaved logs, without any wire/schema change. - New include/libe3/latency.hpp: E3_LAT / E3_LAT_CLOCK_OFFSET macros emitting a single machine-parseable INFO line ([LAT] stage=<name> t_ns=<monotonic ns> anchor_ns=<producer_ts|0> [k=v ...]). t_ns uses steady_clock (== CLOCK_MONOTONIC on glibc) so it subtracts directly against same-node C timestamps. When disabled the macros collapse to a dead NullLatSink chain (zero cost). - New CMake option LIBE3_ENABLE_LATENCY (default OFF) -> defines LIBE3_LATENCY on both library targets. Gating is the compile switch, not the log level. - e3_interface.cpp: ind_wire_tx (outbound send), ctrl_wire_rx (inbound control off the wire) and ctrl_dispatch (handoff to the SM), plus a per-process clock_offset marker at inbound-loop start for future cross-node alignment.
209dd6d to
a4c1818
Compare
|
Closing as superseded by The Thanks for the exploration — the boundary choices (send/receive/dispatch) |
What
Compile-gated
[LAT]log markers on the E3 send / receive / dispatch boundaries, so the end-to-end critical path can be measured offline from interleaved logs — no wire or schema change.How
include/libe3/latency.hpp—E3_LAT/E3_LAT_CLOCK_OFFSETmacros emitting one machine-parseable INFO line:t_nsusessteady_clock(==CLOCK_MONOTONICon glibc), so it subtracts directly against same-node C timestamps. When disabled the macros collapse to a deadNullLatSinkchain (zero cost).LIBE3_ENABLE_LATENCY(defaultOFF) → definesLIBE3_LATENCYon both library targets. Gating is the compile switch, not the log level — a profiling run does not have to raise the logger toDEBUG.src/core/e3_interface.cpp:ind_wire_tx(outbound send),ctrl_wire_rx(inbound control off the wire),ctrl_dispatch(handoff to the SM), plus a per-processclock_offsetmarker at inbound-loop start.Enabling
Testing
Default builds are unaffected (macros expand away). With the option on,
[LAT]lines appear at INFO for each boundary plus oneclock_offsetline at startup.