Generated vote size histogram (#4751)
This commit is contained in:
parent
75bee9463d
commit
c22851b107
2 changed files with 6 additions and 6 deletions
|
|
@ -540,6 +540,8 @@ enum class sample
|
||||||
active_election_duration,
|
active_election_duration,
|
||||||
bootstrap_tag_duration,
|
bootstrap_tag_duration,
|
||||||
rep_response_time,
|
rep_response_time,
|
||||||
|
vote_generator_final_hashes,
|
||||||
|
vote_generator_hashes,
|
||||||
|
|
||||||
_last // Must be the last enum
|
_last // Must be the last enum
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -124,15 +124,12 @@ void nano::vote_generator::process_batch (std::deque<queue_entry_t> & batch)
|
||||||
if (is_final)
|
if (is_final)
|
||||||
{
|
{
|
||||||
transaction_variant_t transaction_variant{ ledger.tx_begin_write (nano::store::writer::voting_final) };
|
transaction_variant_t transaction_variant{ ledger.tx_begin_write (nano::store::writer::voting_final) };
|
||||||
|
|
||||||
verify_batch (transaction_variant, batch);
|
verify_batch (transaction_variant, batch);
|
||||||
|
|
||||||
// Commit write transaction
|
// Commit write transaction
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
transaction_variant_t transaction_variant{ ledger.tx_begin_read () };
|
transaction_variant_t transaction_variant{ ledger.tx_begin_read () };
|
||||||
|
|
||||||
verify_batch (transaction_variant, batch);
|
verify_batch (transaction_variant, batch);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -208,9 +205,10 @@ void nano::vote_generator::broadcast (nano::unique_lock<nano::mutex> & lock_a)
|
||||||
if (!hashes.empty ())
|
if (!hashes.empty ())
|
||||||
{
|
{
|
||||||
lock_a.unlock ();
|
lock_a.unlock ();
|
||||||
vote (hashes, roots, [this] (auto const & vote_a) {
|
vote (hashes, roots, [this] (auto const & generated_vote) {
|
||||||
this->broadcast_action (vote_a);
|
stats.inc (nano::stat::type::vote_generator, nano::stat::detail::generator_broadcasts);
|
||||||
this->stats.inc (nano::stat::type::vote_generator, nano::stat::detail::generator_broadcasts);
|
stats.sample (is_final ? nano::stat::sample::vote_generator_final_hashes : nano::stat::sample::vote_generator_hashes, generated_vote->hashes.size (), { 0, nano::network::confirm_ack_hashes_max });
|
||||||
|
broadcast_action (generated_vote);
|
||||||
});
|
});
|
||||||
lock_a.lock ();
|
lock_a.lock ();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue