diff --git a/nano/node/monitor.cpp b/nano/node/monitor.cpp index 92d19ffe8d..15b98b89d4 100644 --- a/nano/node/monitor.cpp +++ b/nano/node/monitor.cpp @@ -85,11 +85,17 @@ void nano::monitor::run_one () blocks_confirmed_rate, blocks_checked_rate); - logger.info (nano::log::type::monitor, "Peers: {} (stake peered: {} | stake online: {} | quorum: {})", + logger.info (nano::log::type::monitor, "Peers: {} (realtime: {} | bootstrap: {} | inbound connections: {} | outbound connections: {})", node.network.size (), + node.tcp_listener.realtime_count (), + node.tcp_listener.bootstrap_count (), + node.tcp_listener.connection_count (nano::transport::tcp_listener::connection_type::inbound), + node.tcp_listener.connection_count (nano::transport::tcp_listener::connection_type::outbound)); + + logger.info (nano::log::type::monitor, "Quorum: {} (stake peered: {} | stake online: {})", + nano::uint128_union{ node.online_reps.delta () }.format_balance (Mxrb_ratio, 1, true), nano::uint128_union{ node.rep_crawler.total_weight () }.format_balance (Mxrb_ratio, 1, true), - nano::uint128_union{ node.online_reps.online () }.format_balance (Mxrb_ratio, 1, true), - nano::uint128_union{ node.online_reps.delta () }.format_balance (Mxrb_ratio, 1, true)); + nano::uint128_union{ node.online_reps.online () }.format_balance (Mxrb_ratio, 1, true)); logger.info (nano::log::type::monitor, "Elections active: {} (priority: {} | hinted: {} | optimistic: {})", node.active.size (), diff --git a/nano/node/transport/tcp_listener.cpp b/nano/node/transport/tcp_listener.cpp index b97c116854..06c49332ad 100644 --- a/nano/node/transport/tcp_listener.cpp +++ b/nano/node/transport/tcp_listener.cpp @@ -499,6 +499,12 @@ size_t nano::transport::tcp_listener::connection_count () const return connections.size (); } +size_t nano::transport::tcp_listener::connection_count (connection_type type) const +{ + nano::lock_guard lock{ mutex }; + return count_per_type (type); +} + size_t nano::transport::tcp_listener::attempt_count () const { nano::lock_guard lock{ mutex }; diff --git a/nano/node/transport/tcp_listener.hpp b/nano/node/transport/tcp_listener.hpp index 094560477a..55d0603d88 100644 --- a/nano/node/transport/tcp_listener.hpp +++ b/nano/node/transport/tcp_listener.hpp @@ -53,6 +53,13 @@ class tcp_config */ class tcp_listener final { +public: + enum class connection_type + { + inbound, + outbound, + }; + public: tcp_listener (uint16_t port, tcp_config const &, nano::node &); ~tcp_listener (); @@ -69,6 +76,7 @@ class tcp_listener final nano::tcp_endpoint endpoint () const; size_t connection_count () const; + size_t connection_count (connection_type) const; size_t attempt_count () const; size_t realtime_count () const; size_t bootstrap_count () const; @@ -104,12 +112,6 @@ class tcp_listener final error, }; - enum class connection_type - { - inbound, - outbound, - }; - asio::awaitable connect_impl (asio::ip::tcp::endpoint); asio::awaitable connect_socket (asio::ip::tcp::endpoint);