diff --git a/src/libxrpl/telemetry/NullTelemetry.cpp b/src/libxrpl/telemetry/NullTelemetry.cpp index 543f58bf0f..a8dd40f322 100644 --- a/src/libxrpl/telemetry/NullTelemetry.cpp +++ b/src/libxrpl/telemetry/NullTelemetry.cpp @@ -36,7 +36,6 @@ #endif #include -#include #include namespace xrpl::telemetry { diff --git a/src/libxrpl/telemetry/TelemetryConfig.cpp b/src/libxrpl/telemetry/TelemetryConfig.cpp index dc208eed4a..86fb632185 100644 --- a/src/libxrpl/telemetry/TelemetryConfig.cpp +++ b/src/libxrpl/telemetry/TelemetryConfig.cpp @@ -185,7 +185,7 @@ requireReadableFile(std::string const& path, char const* configKey) { reason = "not a regular file"; } - else if (std::ifstream stream{path, std::ios::in}; !stream) + else if (std::ifstream const stream{path, std::ios::in}; !stream) { reason = std::error_code{errno, std::generic_category()}.message(); } diff --git a/src/tests/libxrpl/beast/insight/StatsDCollector.cpp b/src/tests/libxrpl/beast/insight/StatsDCollector.cpp index 7024318ec8..aaab3e571e 100644 --- a/src/tests/libxrpl/beast/insight/StatsDCollector.cpp +++ b/src/tests/libxrpl/beast/insight/StatsDCollector.cpp @@ -1,7 +1,5 @@ #include -#include -#include #include #include @@ -39,6 +37,7 @@ namespace beast::insight { * "test", * Journal(Journal::getNullSink())); * auto const gauge = collector->makeGauge("g"); + * collector->onCollectionReady(); // Nothing is polled before this. * EXPECT_EQ(server.receive(std::chrono::seconds(10)), "test.g:0|g\n"); * * // Edge case: nothing was sent, so the wait runs out and returns empty. @@ -128,6 +127,10 @@ TEST(StatsDCollector, UntouchedGaugePublishesInitialZero) // Created and then left alone: no set(), no increment(). auto const gauge = collector->makeGauge("untouched"); + // A collector polls its metrics only after this. Without the call no tick + // ever flushes and every assertion below would hold for the wrong reason. + collector->onCollectionReady(); + EXPECT_EQ(server.receive(std::chrono::seconds(10)), std::string("test.untouched:0|g\n")); } @@ -146,6 +149,10 @@ TEST(StatsDCollector, UntouchedCounterPublishesNothing) auto collector = StatsDCollector::make(address, "test", Journal(Journal::getNullSink())); auto const counter = collector->makeCounter("untouched"); + // Same reason as above: polling must be on, or the empty result proves only + // that nothing was polled. + collector->onCollectionReady(); + // Three seconds spans several one-second flush ticks. EXPECT_EQ(server.receive(std::chrono::seconds(3)), std::string()); } diff --git a/src/xrpld/app/misc/detail/TxQ.cpp b/src/xrpld/app/misc/detail/TxQ.cpp index d98736e9f2..e6626473e0 100644 --- a/src/xrpld/app/misc/detail/TxQ.cpp +++ b/src/xrpld/app/misc/detail/TxQ.cpp @@ -807,9 +807,13 @@ TxQ::apply( { span.setAttribute(txq_span::attr::terCode, transToken(directApplied->ter).c_str()); if (directApplied->applied) + { span.setAttribute(txq_span::attr::txqStatus, txq_span::val::appliedDirect); + } else + { span.setAttribute(txq_span::attr::txqStatus, txq_span::val::failed); + } } return *directApplied; }