|
14 | 14 | #include <xrpld/consensus/LedgerTiming.h> |
15 | 15 | #include <xrpld/overlay/Overlay.h> |
16 | 16 | #include <xrpld/overlay/predicates.h> |
| 17 | +#include <xrpld/telemetry/TracingInstrumentation.h> |
17 | 18 |
|
18 | 19 | #include <xrpl/basics/random.h> |
19 | 20 | #include <xrpl/beast/core/LexicalCast.h> |
@@ -173,6 +174,9 @@ RCLConsensus::Adaptor::share(RCLCxTx const& tx) |
173 | 174 | void |
174 | 175 | RCLConsensus::Adaptor::propose(RCLCxPeerPos::Proposal const& proposal) |
175 | 176 | { |
| 177 | + XRPL_TRACE_CONSENSUS(app_.getTelemetry(), "consensus.proposal.send"); |
| 178 | + XRPL_TRACE_SET_ATTR("xrpl.consensus.round", static_cast<int64_t>(proposal.proposeSeq())); |
| 179 | + |
176 | 180 | JLOG(j_.trace()) << (proposal.isBowOut() ? "We bow out: " : "We propose: ") |
177 | 181 | << xrpl::to_string(proposal.prevLedger()) << " -> " |
178 | 182 | << xrpl::to_string(proposal.position()); |
@@ -275,6 +279,11 @@ RCLConsensus::Adaptor::onClose( |
275 | 279 | NetClock::time_point const& closeTime, |
276 | 280 | ConsensusMode mode) -> Result |
277 | 281 | { |
| 282 | + XRPL_TRACE_CONSENSUS(app_.getTelemetry(), "consensus.ledger_close"); |
| 283 | + XRPL_TRACE_SET_ATTR( |
| 284 | + "xrpl.consensus.ledger.seq", static_cast<int64_t>(ledger.ledger_->header().seq + 1)); |
| 285 | + XRPL_TRACE_SET_ATTR("xrpl.consensus.mode", to_string(mode).c_str()); |
| 286 | + |
278 | 287 | bool const wrongLCL = mode == ConsensusMode::wrongLedger; |
279 | 288 | bool const proposing = mode == ConsensusMode::proposing; |
280 | 289 |
|
@@ -383,6 +392,11 @@ RCLConsensus::Adaptor::onAccept( |
383 | 392 | Json::Value&& consensusJson, |
384 | 393 | bool const validating) |
385 | 394 | { |
| 395 | + XRPL_TRACE_CONSENSUS(app_.getTelemetry(), "consensus.accept"); |
| 396 | + XRPL_TRACE_SET_ATTR("xrpl.consensus.proposers", static_cast<int64_t>(result.proposers)); |
| 397 | + XRPL_TRACE_SET_ATTR( |
| 398 | + "xrpl.consensus.round_time_ms", static_cast<int64_t>(result.roundTime.read().count())); |
| 399 | + |
386 | 400 | app_.getJobQueue().addJob( |
387 | 401 | jtACCEPT, "AcceptLedger", [=, this, cj = std::move(consensusJson)]() mutable { |
388 | 402 | // Note that no lock is held or acquired during this job. |
@@ -736,6 +750,10 @@ RCLConsensus::Adaptor::buildLCL( |
736 | 750 | void |
737 | 751 | RCLConsensus::Adaptor::validate(RCLCxLedger const& ledger, RCLTxSet const& txns, bool proposing) |
738 | 752 | { |
| 753 | + XRPL_TRACE_CONSENSUS(app_.getTelemetry(), "consensus.validation.send"); |
| 754 | + XRPL_TRACE_SET_ATTR("xrpl.consensus.ledger.seq", static_cast<int64_t>(ledger.seq())); |
| 755 | + XRPL_TRACE_SET_ATTR("xrpl.consensus.proposing", proposing); |
| 756 | + |
739 | 757 | using namespace std::chrono_literals; |
740 | 758 |
|
741 | 759 | auto validationTime = app_.timeKeeper().closeTime(); |
|
0 commit comments