mirror of
https://github.com/ton-blockchain/ton
synced 2025-03-09 15:40:10 +00:00
Add more stats to validator getstats
1) Liteserver queries count 2) Collated/validated blocks count, number of active sessions 3) Persistent state sizes 4) Initial sync progress
This commit is contained in:
parent
ce6c29941e
commit
9d94e04d20
26 changed files with 365 additions and 45 deletions
|
@ -85,19 +85,13 @@ void LiteQuery::abort_query(td::Status reason) {
|
|||
if (acc_state_promise_) {
|
||||
acc_state_promise_.set_error(std::move(reason));
|
||||
} else if (promise_) {
|
||||
td::actor::send_closure(manager_, &ValidatorManager::add_lite_query_stats, query_obj_ ? query_obj_->get_id() : 0,
|
||||
false);
|
||||
promise_.set_error(std::move(reason));
|
||||
}
|
||||
stop();
|
||||
}
|
||||
|
||||
void LiteQuery::abort_query_ext(td::Status reason, std::string comment) {
|
||||
LOG(INFO) << "aborted liteserver query: " << comment << " : " << reason.to_string();
|
||||
if (promise_) {
|
||||
promise_.set_error(reason.move_as_error_prefix(comment + " : "));
|
||||
}
|
||||
stop();
|
||||
}
|
||||
|
||||
bool LiteQuery::fatal_error(td::Status error) {
|
||||
abort_query(std::move(error));
|
||||
return false;
|
||||
|
@ -120,6 +114,8 @@ bool LiteQuery::finish_query(td::BufferSlice result, bool skip_cache_update) {
|
|||
td::actor::send_closure(cache_, &LiteServerCache::update, cache_key_, result.clone());
|
||||
}
|
||||
if (promise_) {
|
||||
td::actor::send_closure(manager_, &ValidatorManager::add_lite_query_stats, query_obj_ ? query_obj_->get_id() : 0,
|
||||
true);
|
||||
promise_.set_result(std::move(result));
|
||||
stop();
|
||||
return true;
|
||||
|
@ -139,7 +135,6 @@ void LiteQuery::start_up() {
|
|||
|
||||
auto F = fetch_tl_object<ton::lite_api::Function>(query_, true);
|
||||
if (F.is_error()) {
|
||||
td::actor::send_closure(manager_, &ValidatorManager::add_lite_query_stats, 0); // unknown
|
||||
abort_query(F.move_as_error());
|
||||
return;
|
||||
}
|
||||
|
@ -192,7 +187,6 @@ bool LiteQuery::use_cache() {
|
|||
}
|
||||
|
||||
void LiteQuery::perform() {
|
||||
td::actor::send_closure(manager_, &ValidatorManager::add_lite_query_stats, query_obj_->get_id());
|
||||
lite_api::downcast_call(
|
||||
*query_obj_,
|
||||
td::overloaded(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue