mirror of
https://github.com/ton-blockchain/ton
synced 2025-03-09 15:40:10 +00:00
Merge branch 'testnet' into block-generation
# Conflicts: # overlay/overlay-fec-broadcast.cpp # overlay/overlay.hpp # tl/generate/scheme/ton_api.tl # tl/generate/scheme/ton_api.tlo # validator-engine-console/validator-engine-console-query.cpp # validator-engine-console/validator-engine-console-query.h # validator-engine-console/validator-engine-console.cpp # validator-engine/validator-engine.cpp # validator-engine/validator-engine.hpp # validator/downloaders/wait-block-state.hpp # validator/impl/validate-query.cpp # validator/validator.h
This commit is contained in:
commit
636348ffc2
110 changed files with 3822 additions and 696 deletions
|
@ -1009,6 +1009,56 @@ td::Status ImportShardOverlayCertificateQuery::receive(td::BufferSlice data) {
|
|||
return td::Status::OK();
|
||||
}
|
||||
|
||||
td::Status GetPerfTimerStatsJsonQuery::run() {
|
||||
TRY_RESULT_ASSIGN(file_name_, tokenizer_.get_token<std::string>());
|
||||
TRY_STATUS(tokenizer_.check_endl());
|
||||
return td::Status::OK();
|
||||
}
|
||||
|
||||
td::Status GetPerfTimerStatsJsonQuery::send() {
|
||||
auto b = ton::create_serialize_tl_object<ton::ton_api::engine_validator_getPerfTimerStats>("");
|
||||
td::actor::send_closure(console_, &ValidatorEngineConsole::envelope_send_query, std::move(b), create_promise());
|
||||
return td::Status::OK();
|
||||
}
|
||||
|
||||
td::Status GetPerfTimerStatsJsonQuery::receive(td::BufferSlice data) {
|
||||
TRY_RESULT_PREFIX(f, ton::fetch_tl_object<ton::ton_api::engine_validator_perfTimerStats>(data.as_slice(), true),
|
||||
"received incorrect answer: ");
|
||||
std::ofstream sb(file_name_);
|
||||
|
||||
sb << "{";
|
||||
bool gtail = false;
|
||||
for (const auto &v : f->stats_) {
|
||||
if (gtail) {
|
||||
sb << ",";
|
||||
} else {
|
||||
gtail = true;
|
||||
}
|
||||
|
||||
sb << "\n \"" << v->name_ << "\": {";
|
||||
bool tail = false;
|
||||
for (const auto &stat : v->stats_) {
|
||||
if (tail) {
|
||||
sb << ",";
|
||||
} else {
|
||||
tail = true;
|
||||
}
|
||||
|
||||
sb << "\n \"" << stat->time_ << "\": [";
|
||||
sb << "\n " << stat->min_ << ",";
|
||||
sb << "\n " << stat->avg_ << ",";
|
||||
sb << "\n " << stat->max_;
|
||||
sb << "\n ]";
|
||||
}
|
||||
sb << "\n }";
|
||||
}
|
||||
sb << "\n}\n";
|
||||
sb << std::flush;
|
||||
|
||||
td::TerminalIO::output(std::string("wrote stats to " + file_name_ + "\n"));
|
||||
return td::Status::OK();
|
||||
}
|
||||
|
||||
td::Status GetValidatorSessionsInfoQuery::run() {
|
||||
TRY_STATUS(tokenizer_.check_endl());
|
||||
return td::Status::OK();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue