Add vote overflow stats (#1394)

This commit is contained in:
cryptocode 2018-11-19 23:48:03 +01:00 committed by Roy Keene
commit a34ef934c3
3 changed files with 10 additions and 2 deletions

View file

@ -868,9 +868,13 @@ void rai::vote_processor::vote (std::shared_ptr<rai::vote> 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";
}
}
}
}

View file

@ -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;

View file

@ -229,6 +229,7 @@ public:
vote_valid,
vote_replay,
vote_invalid,
vote_overflow,
// udp
blocking,