mirror of
https://github.com/XRPLF/rippled.git
synced 2026-09-27 15:28:03 +00:00
Merge branch 'pratik/otel-phase9-metric-gap-fill' into pratik/otel-phase10-workload-validation
This commit is contained in:
@@ -36,7 +36,6 @@
|
||||
#endif
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
|
||||
namespace xrpl::telemetry {
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
#include <xrpl/beast/insight/StatsDCollector.h>
|
||||
|
||||
#include <xrpl/beast/insight/Counter.h>
|
||||
#include <xrpl/beast/insight/Gauge.h>
|
||||
#include <xrpl/beast/net/IPEndpoint.h>
|
||||
#include <xrpl/beast/utility/Journal.h>
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
|
||||
@@ -808,9 +808,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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user