From 5b2e96c2fa4b9d9128bd63168fa59cdee67508d3 Mon Sep 17 00:00:00 2001 From: Ivan Siomash <106972486+legaii@users.noreply.github.com> Date: Thu, 15 Sep 2022 10:26:17 +0300 Subject: [PATCH] Fixes for GetPerfTimerStats (#457) * getperftimerstatsjson: fix json format * getperftimerstatsjson: fix td::min ambiguous template parameter --- validator-engine-console/validator-engine-console-query.cpp | 4 ++-- validator-engine/validator-engine.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/validator-engine-console/validator-engine-console-query.cpp b/validator-engine-console/validator-engine-console-query.cpp index 261c0616..1aee7cc4 100644 --- a/validator-engine-console/validator-engine-console-query.cpp +++ b/validator-engine-console/validator-engine-console-query.cpp @@ -1032,7 +1032,7 @@ td::Status GetPerfTimerStatsJsonQuery::receive(td::BufferSlice data) { gtail = true; } - sb << "\n '" << v->name_ << "': {"; + sb << "\n \"" << v->name_ << "\": {"; bool tail = false; for (const auto &stat : v->stats_) { if (tail) { @@ -1041,7 +1041,7 @@ td::Status GetPerfTimerStatsJsonQuery::receive(td::BufferSlice data) { tail = true; } - sb << "\n " << stat->time_ << ": ["; + sb << "\n \"" << stat->time_ << "\": ["; sb << "\n " << stat->min_ << ","; sb << "\n " << stat->avg_ << ","; sb << "\n " << stat->max_; diff --git a/validator-engine/validator-engine.cpp b/validator-engine/validator-engine.cpp index 9679ee01..a8e46eed 100644 --- a/validator-engine/validator-engine.cpp +++ b/validator-engine/validator-engine.cpp @@ -3314,8 +3314,8 @@ void ValidatorEngine::run_control_query(ton::ton_api::engine_validator_getPerfTi int cnt = 0; for (const auto &[time, duration] : stats.stats) { if (now - time <= static_cast(t)) { - min = td::min(min, duration); - max = td::max(max, duration); + min = td::min(min, duration); + max = td::max(max, duration); sum += duration; ++cnt; }