mirror of
https://github.com/ton-blockchain/ton
synced 2025-03-09 15:40:10 +00:00
Add more info to session stats (#973)
* Improve validator session stats * Improve validator session stats Add got_submit_at, collation_cached, validation_cached. Fix stats cleanup. * Fix setting timestamp for cached blocks * Add serialize/deserialize time, serialized size to validator session stats, fix setting is_accepted --------- Co-authored-by: SpyCheese <mikle98@yandex.ru>
This commit is contained in:
parent
d2b012c883
commit
9a543c6b28
10 changed files with 309 additions and 68 deletions
|
@ -159,10 +159,19 @@ class ValidatorSessionImpl : public ValidatorSession {
|
|||
bool compress_block_candidates_ = false;
|
||||
|
||||
ValidatorSessionStats cur_stats_;
|
||||
bool stats_inited_ = false;
|
||||
std::map<std::pair<td::uint32, ValidatorSessionCandidateId>, std::vector<td::uint32>>
|
||||
stats_pending_approve_; // round, candidate_id -> approvers
|
||||
std::map<std::pair<td::uint32, ValidatorSessionCandidateId>, std::vector<td::uint32>>
|
||||
stats_pending_sign_; // round, candidate_id -> signers
|
||||
void stats_init();
|
||||
void stats_add_round();
|
||||
void stats_set_candidate_status(td::uint32 round, PublicKeyHash src, ValidatorSessionCandidateId candidate_id,
|
||||
int status, std::string comment = "");
|
||||
ValidatorSessionStats::Producer *stats_get_candidate_stat(
|
||||
td::uint32 round, PublicKeyHash src,
|
||||
ValidatorSessionCandidateId candidate_id = ValidatorSessionCandidateId::zero());
|
||||
ValidatorSessionStats::Producer *stats_get_candidate_stat_by_id(td::uint32 round,
|
||||
ValidatorSessionCandidateId candidate_id);
|
||||
void stats_process_action(td::uint32 node_id, ton_api::validatorSession_round_Message &action);
|
||||
|
||||
public:
|
||||
ValidatorSessionImpl(catchain::CatChainSessionId session_id, ValidatorSessionOptions opts, PublicKeyHash local_id,
|
||||
|
@ -190,17 +199,16 @@ class ValidatorSessionImpl : public ValidatorSession {
|
|||
void process_query(PublicKeyHash src, td::BufferSlice data, td::Promise<td::BufferSlice> promise);
|
||||
|
||||
void try_approve_block(const SentBlock *block);
|
||||
void try_sign();
|
||||
|
||||
void candidate_decision_fail(td::uint32 round, ValidatorSessionCandidateId hash, std::string result,
|
||||
td::uint32 src, td::BufferSlice proof);
|
||||
void candidate_decision_fail(td::uint32 round, ValidatorSessionCandidateId hash, std::string result, td::uint32 src,
|
||||
td::BufferSlice proof, double validation_time, bool validation_cached);
|
||||
void candidate_decision_ok(td::uint32 round, ValidatorSessionCandidateId hash, RootHash root_hash, FileHash file_hash,
|
||||
td::uint32 src, td::uint32 ok_from);
|
||||
td::uint32 src, td::uint32 ok_from, double validation_time, bool validation_cached);
|
||||
void candidate_approved_signed(td::uint32 round, ValidatorSessionCandidateId hash, td::uint32 ok_from,
|
||||
td::BufferSlice signature);
|
||||
|
||||
void generated_block(td::uint32 round, ValidatorSessionRootHash root_hash, td::BufferSlice data,
|
||||
td::BufferSlice collated);
|
||||
td::BufferSlice collated, double collation_time, bool collation_cached);
|
||||
void signed_block(td::uint32 round, ValidatorSessionCandidateId hash, td::BufferSlice signature);
|
||||
|
||||
void end_request(td::uint32 round, ValidatorSessionCandidateId block_id) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue