mirror of
https://github.com/XRPLF/rippled.git
synced 2026-09-30 16:58:30 +00:00
dialStart_, outcomeReported_ and dialSpan_ are telemetry-only. dialStart_ is read only by the two elapsed-time computations in reportOutcome(); outcomeReported_ is written and read only there; dialSpan_ is opened in run(), ended in reportOutcome() and reset in the destructor, and read nowhere else. outcomeReported_ is not load-bearing for anything but telemetry. It is a first-call-wins latch over the histogram, the counter and the span attributes. Every terminal path calls close() or fail() itself, beside its reportOutcome() call rather than inside it, so suppressing a second report cannot suppress any teardown. Guard the three sites: the clock and span setup in run(), the whole body of reportOutcome(), and the destructor's reset(). Per outbound dial that removes a steady_clock reading, an optional emplace and reset of a span handle, and the latch write. The members stay declared in every configuration so the class has one shape; only the writes are compiled out. SpanGuard.h, SpanNames.h, MetricMacros.h and the cstdint header move behind the guard with the code that names them. ConnectAttempt.h still includes SpanGuard.h for the member.
XRPL Source Guidelines
Each folder contains a single module following the newest style:
- One class per header
- As much implementation hidden as possible
- All major interfaces are abstract
- Every class is documented
- Each module focuses on solving one problem