From a34ef934c3a9d36697fc0a16ef0e0b5c46e55acd Mon Sep 17 00:00:00 2001 From: cryptocode <34946442+cryptocode@users.noreply.github.com> Date: Mon, 19 Nov 2018 23:48:03 +0100 Subject: [PATCH] Add vote overflow stats (#1394) --- rai/node/node.cpp | 8 ++++++-- rai/node/stats.cpp | 3 +++ rai/node/stats.hpp | 1 + 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/rai/node/node.cpp b/rai/node/node.cpp index 88dcefd8..fb1de25c 100644 --- a/rai/node/node.cpp +++ b/rai/node/node.cpp @@ -868,9 +868,13 @@ void rai::vote_processor::vote (std::shared_ptr vote_a, rai::endpoint votes.push_back (std::make_pair (vote_a, endpoint_a)); condition.notify_all (); } - else if (node.config.logging.vote_logging ()) + else { - BOOST_LOG (node.log) << "Votes overflow"; + node.stats.inc (rai::stat::type::vote, rai::stat::detail::vote_overflow); + if (node.config.logging.vote_logging ()) + { + BOOST_LOG (node.log) << "Votes overflow"; + } } } } diff --git a/rai/node/stats.cpp b/rai/node/stats.cpp index 5cdc4bb5..835ed604 100644 --- a/rai/node/stats.cpp +++ b/rai/node/stats.cpp @@ -436,6 +436,9 @@ std::string rai::stat::detail_to_string (uint32_t key) case rai::stat::detail::vote_invalid: res = "vote_invalid"; break; + case rai::stat::detail::vote_overflow: + res = "vote_overflow"; + break; case rai::stat::detail::blocking: res = "blocking"; break; diff --git a/rai/node/stats.hpp b/rai/node/stats.hpp index 7d99f8da..67028e99 100644 --- a/rai/node/stats.hpp +++ b/rai/node/stats.hpp @@ -229,6 +229,7 @@ public: vote_valid, vote_replay, vote_invalid, + vote_overflow, // udp blocking,