|
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,16 @@ 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", |
| 285 | + static_cast<int64_t>(ledger.ledger_->header().seq + 1)); |
| 286 | + XRPL_TRACE_SET_ATTR( |
| 287 | + "xrpl.consensus.mode", |
| 288 | + (mode == ConsensusMode::proposing |
| 289 | + ? "proposing" |
| 290 | + : (mode == ConsensusMode::observing ? "observing" : "wrongLedger"))); |
| 291 | + |
278 | 292 | bool const wrongLCL = mode == ConsensusMode::wrongLedger; |
279 | 293 | bool const proposing = mode == ConsensusMode::proposing; |
280 | 294 |
|
@@ -383,6 +397,12 @@ RCLConsensus::Adaptor::onAccept( |
383 | 397 | Json::Value&& consensusJson, |
384 | 398 | bool const validating) |
385 | 399 | { |
| 400 | + XRPL_TRACE_CONSENSUS(app_.getTelemetry(), "consensus.accept"); |
| 401 | + XRPL_TRACE_SET_ATTR("xrpl.consensus.proposers", static_cast<int64_t>(result.proposers)); |
| 402 | + XRPL_TRACE_SET_ATTR( |
| 403 | + "xrpl.consensus.round_time_ms", |
| 404 | + static_cast<int64_t>(result.roundTime.read().count())); |
| 405 | + |
386 | 406 | app_.getJobQueue().addJob( |
387 | 407 | jtACCEPT, "AcceptLedger", [=, this, cj = std::move(consensusJson)]() mutable { |
388 | 408 | // Note that no lock is held or acquired during this job. |
@@ -736,6 +756,10 @@ RCLConsensus::Adaptor::buildLCL( |
736 | 756 | void |
737 | 757 | RCLConsensus::Adaptor::validate(RCLCxLedger const& ledger, RCLTxSet const& txns, bool proposing) |
738 | 758 | { |
| 759 | + XRPL_TRACE_CONSENSUS(app_.getTelemetry(), "consensus.validation.send"); |
| 760 | + XRPL_TRACE_SET_ATTR("xrpl.consensus.ledger.seq", static_cast<int64_t>(ledger.seq())); |
| 761 | + XRPL_TRACE_SET_ATTR("xrpl.consensus.proposing", proposing); |
| 762 | + |
739 | 763 | using namespace std::chrono_literals; |
740 | 764 |
|
741 | 765 | auto validationTime = app_.timeKeeper().closeTime(); |
|
0 commit comments