mirror of
https://github.com/ton-blockchain/ton
synced 2025-03-09 15:40:10 +00:00
Improve validator session stats
* Collator stats: block limits, number of processed external messages * Collator and validator work time * Last key block seqno * Approvers and signers
This commit is contained in:
parent
06515c3735
commit
0ca022cc72
15 changed files with 276 additions and 24 deletions
|
@ -52,6 +52,16 @@ struct AsyncSerializerState {
|
|||
UnixTime last_written_block_ts;
|
||||
};
|
||||
|
||||
struct CollationStats {
|
||||
td::uint32 bytes, gas, lt_delta;
|
||||
int cat_bytes, cat_gas, cat_lt_delta;
|
||||
std::string limits_log;
|
||||
td::uint32 ext_msgs_total = 0;
|
||||
td::uint32 ext_msgs_filtered = 0;
|
||||
td::uint32 ext_msgs_accepted = 0;
|
||||
td::uint32 ext_msgs_rejected = 0;
|
||||
};
|
||||
|
||||
using ValidateCandidateResult = td::Variant<UnixTime, CandidateReject>;
|
||||
|
||||
class ValidatorManager : public ValidatorManagerInterface {
|
||||
|
@ -192,6 +202,12 @@ class ValidatorManager : public ValidatorManagerInterface {
|
|||
virtual void add_lite_query_stats(int lite_query_id) {
|
||||
}
|
||||
|
||||
virtual void record_collate_query_stats(BlockIdExt block_id, double work_time, double cpu_work_time,
|
||||
CollationStats stats) {
|
||||
}
|
||||
virtual void record_validate_query_stats(BlockIdExt block_id, double work_time, double cpu_work_time) {
|
||||
}
|
||||
|
||||
static bool is_persistent_state(UnixTime ts, UnixTime prev_ts) {
|
||||
return ts / (1 << 17) != prev_ts / (1 << 17);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue