Skip to content

Commit ea3ffe3

Browse files
committed
Log peer connection when logging autoconnect preparation.
1 parent 095bc09 commit ea3ffe3

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

src/xrpld/peerfinder/detail/Counts.h

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,25 @@ class Counts
249249
return ss.str();
250250
}
251251

252+
std::string
253+
stats() const {
254+
std::stringstream ss;
255+
ss << "peer stats, "
256+
<< "outbound attempts: " << m_attempts
257+
<< " active connections: " << m_active
258+
<< " inbound slots: " << m_in_max
259+
<< " active inbound slots: " << m_in_active
260+
<< " outbound slots: " << m_out_max
261+
<< " active outbound slots: " << m_out_active
262+
<< " fixed: " << m_fixed
263+
<< " active fixed: " << m_fixed_active
264+
<< " reserved: " << m_reserved
265+
<< " inbound not active or closing: " << m_acceptCount
266+
<< " closing: " << m_closingCount
267+
<< ". ";
268+
return ss.str();
269+
}
270+
252271
//--------------------------------------------------------------------------
253272
private:
254273
// Adjusts counts based on the specified slot, in the direction indicated.

src/xrpld/peerfinder/detail/Logic.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,7 @@ class Logic
494494
autoconnect()
495495
{
496496
std::stringstream ss;
497-
ss << "AUTOCONNECT ";
497+
ss << "AUTOCONNECT " << counts_.stats();
498498
std::vector<beast::IP::Endpoint> const none;
499499

500500
std::lock_guard _(lock_);

0 commit comments

Comments
 (0)