mirror of
https://github.com/XRPLF/rippled.git
synced 2026-10-03 18:28:07 +00:00
fix(telemetry): make this branch's files compile clean with telemetry off
The metric macros discard their arguments when telemetry is compiled out, so a file's used-symbol set differs from the one its includes and declarations were written for. That produced eleven clang-tidy errors here, all from that cause. - guard <atomic>, <functional> and <memory> in MetricsRegistry.h, and <algorithm> and <optional> in DatabaseConfig_test.cpp, to match their uses - include Journal.h directly in MetricsRegistry.cpp, whose constructor takes a beast::Journal by value in both configurations - compile out recordGetObjectMetrics, its declaration, its call site and the two clock reads that feed it, since every statement in it records a metric - drop two duplicate includes and rename a function-local static constant to kEmpty
This commit is contained in:
@@ -33,18 +33,23 @@
|
||||
#include <xrpl/nodestore/detail/DatabaseRotatingImp.h>
|
||||
#include <xrpl/rdb/DatabaseCon.h>
|
||||
|
||||
#include <algorithm>
|
||||
#include <atomic>
|
||||
#include <chrono>
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
#include <memory>
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <type_traits>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
#ifdef XRPL_ENABLE_TELEMETRY
|
||||
// std::ranges::sort / std::ranges::find_if and std::optional / std::nullopt are
|
||||
// used only by the gauge-helper suite below, so they are guarded like its uses.
|
||||
#include <algorithm>
|
||||
#include <optional>
|
||||
#endif
|
||||
|
||||
namespace xrpl::node_store {
|
||||
|
||||
class DatabaseConfig_test : public beast::unit_test::Suite
|
||||
|
||||
Reference in New Issue
Block a user