1
0
Fork 0
mirror of https://github.com/ton-blockchain/ton synced 2025-03-09 15:40:10 +00:00

Fixes for GetPerfTimerStats (#457)

* getperftimerstatsjson: fix json format

* getperftimerstatsjson: fix td::min ambiguous template parameter
This commit is contained in:
Ivan Siomash 2022-09-15 10:26:17 +03:00 committed by GitHub
parent bd5f4f61ac
commit 5b2e96c2fa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View file

@ -1032,7 +1032,7 @@ td::Status GetPerfTimerStatsJsonQuery::receive(td::BufferSlice data) {
gtail = true; gtail = true;
} }
sb << "\n '" << v->name_ << "': {"; sb << "\n \"" << v->name_ << "\": {";
bool tail = false; bool tail = false;
for (const auto &stat : v->stats_) { for (const auto &stat : v->stats_) {
if (tail) { if (tail) {
@ -1041,7 +1041,7 @@ td::Status GetPerfTimerStatsJsonQuery::receive(td::BufferSlice data) {
tail = true; tail = true;
} }
sb << "\n " << stat->time_ << ": ["; sb << "\n \"" << stat->time_ << "\": [";
sb << "\n " << stat->min_ << ","; sb << "\n " << stat->min_ << ",";
sb << "\n " << stat->avg_ << ","; sb << "\n " << stat->avg_ << ",";
sb << "\n " << stat->max_; sb << "\n " << stat->max_;

View file

@ -3314,8 +3314,8 @@ void ValidatorEngine::run_control_query(ton::ton_api::engine_validator_getPerfTi
int cnt = 0; int cnt = 0;
for (const auto &[time, duration] : stats.stats) { for (const auto &[time, duration] : stats.stats) {
if (now - time <= static_cast<double>(t)) { if (now - time <= static_cast<double>(t)) {
min = td::min(min, duration); min = td::min<double>(min, duration);
max = td::max(max, duration); max = td::max<double>(max, duration);
sum += duration; sum += duration;
++cnt; ++cnt;
} }