mirror of
https://github.com/XRPLF/rippled.git
synced 2026-07-24 15:40:26 +00:00
fix(telemetry): resolve clang-tidy CI errors in consensus tracing
Add missing <string_view> include in Consensus.h and RCLConsensus.h. Remove unused SHAMap.h include from RCLConsensus.h. Add braces around single-line if/else bodies in RCLConsensus.cpp. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1269,11 +1269,15 @@ RCLConsensus::Adaptor::startRoundTracing(RCLCxLedger const& prevLgr)
|
||||
// TraceCategory-aware, so gate it explicitly to match the gating
|
||||
// of the hashSpan/span factories used below.
|
||||
if (link != nullptr && app_.getTelemetry().shouldTraceConsensus())
|
||||
{
|
||||
roundSpan_.emplace(telemetry::SpanGuard::linkedSpan(cs::round, *link));
|
||||
}
|
||||
else
|
||||
{
|
||||
roundSpan_.emplace(
|
||||
telemetry::SpanGuard::span(
|
||||
telemetry::TraceCategory::Consensus, telemetry::seg::consensus, cs::op::round));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1289,7 +1293,9 @@ RCLConsensus::Adaptor::startRoundTracing(RCLCxLedger const& prevLgr)
|
||||
}
|
||||
|
||||
if (!*roundSpan_)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
roundSpan_->setAttribute(cs::attr::ledgerId, to_string(prevLgr.id()).c_str());
|
||||
roundSpan_->setAttribute(cs::attr::ledgerSeq, static_cast<int64_t>(prevLgr.seq()) + 1);
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
#include <xrpl/protocol/PublicKey.h>
|
||||
#include <xrpl/protocol/RippleLedgerHash.h>
|
||||
#include <xrpl/protocol/UintTypes.h>
|
||||
#include <xrpl/shamap/SHAMap.h>
|
||||
#include <xrpl/telemetry/SpanGuard.h>
|
||||
|
||||
#include <xrpl.pb.h>
|
||||
@@ -36,6 +35,7 @@
|
||||
#include <set>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
#include <utility>
|
||||
|
||||
namespace xrpl {
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
#include <optional>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
#include <utility>
|
||||
|
||||
namespace xrpl {
|
||||
|
||||
Reference in New Issue
Block a user