fix(telemetry): make this branch's files compile clean with telemetry off

The metric macros discard their arguments when telemetry is compiled out, so
anything named only as a macro argument disappears in that build. That produced
fifteen errors across these files.

- guard MetricNames.h in the nine files whose only uses of it are macro
  arguments; the files that pass those constants as ordinary function
  arguments still need it unconditionally
- drop the prevMode local in setMode, reading the mode being left inline in the
  macro argument so nothing is computed when telemetry is off
- compile out the emit helper in recordBatchOutcome and its three calls, which
  exist only to report per-outcome counters
- drop two includes the telemetry-off test block never used
- suppress the static and const suggestions on four methods whose bodies only
  record metrics; each reads the app_ member when telemetry is enabled
This commit is contained in:
Pratik Mankawde
2026-08-26 18:08:09 +01:00
parent d5f910cfca
commit 08026b46b9
13 changed files with 76 additions and 13 deletions

View File

@@ -468,8 +468,6 @@ TEST(MetricsRegistryScaledMean, default_scale_is_one)
#include <stdexcept>
#include <string>
#include <string_view>
#include <type_traits>
#include <utility>
using namespace xrpl;