mirror of
https://github.com/XRPLF/rippled.git
synced 2026-09-28 07:48:01 +00:00
reportFetchOutcome() exists only to label unl_fetch_total. It reads the parsed URI parts, copies the domain, erases any userinfo with an rfind, joins scheme, host and optional port, then appends a substr of the path -- two std::string allocations and several copies -- and that label has no other reader. It ran on every validator-list fetch, so about once per site every five minutes, whether or not anything could record the counter. Guard the whole body with XRPL_ENABLE_TELEMETRY rather than change the signature: the two failure call sites pass a compile-time constant, so an empty body is all they need. The success call site is guarded too, because its to_string(bestDisposition()) builds a std::string that only the label consumes. bestDisposition() itself keeps running, since lastRefreshStatus stores it. MetricMacros.h moves behind the same guard, as the macro is now named only inside the guarded body. MetricNames.h stays unconditional, because the fetch handlers name the outcome constants either way.