mirror of
https://github.com/ton-blockchain/ton
synced 2025-03-09 15:40:10 +00:00
Add GetPerfTimerStats (#451)
* Add getperfwarningtimeraverage query for validator-engine-console * Fix for getperfwarningtimeraverage query * getperftimerstats * Add history max size: 1 hour * PerfWarningTimer: move callback instead of copy * PerfWarningTimer: fix move constructor bug * PerfWarningTimer: fix bug: lifetime of the callback was greater than lifetime of the local variable 'manager' captured by reference * Fix validate-query.cpp: 'manager' used after it was moved * PerfWarningTimer: remove logs * getperftimerstats: write to json file * getperftimerstatsjson Co-authored-by: legaii <jgates.ardux@gmail.com> Co-authored-by: Ivan Siomash <106972486+legaii@users.noreply.github.com>
This commit is contained in:
parent
8376c289d7
commit
8329a58994
25 changed files with 244 additions and 27 deletions
|
@ -19,6 +19,7 @@
|
|||
#pragma once
|
||||
|
||||
#include <vector>
|
||||
#include <deque>
|
||||
|
||||
#include "td/actor/actor.h"
|
||||
|
||||
|
@ -44,6 +45,11 @@ class DownloadToken {
|
|||
virtual ~DownloadToken() = default;
|
||||
};
|
||||
|
||||
struct PerfTimerStats {
|
||||
std::string name;
|
||||
std::deque<std::pair<double, double>> stats; // <Time::now(), duration>
|
||||
};
|
||||
|
||||
struct ValidatorManagerOptions : public td::CntObject {
|
||||
public:
|
||||
enum class ShardCheckMode { m_monitor, m_validate };
|
||||
|
@ -214,6 +220,9 @@ class ValidatorManagerInterface : public td::actor::Actor {
|
|||
|
||||
virtual void run_ext_query(td::BufferSlice data, td::Promise<td::BufferSlice> promise) = 0;
|
||||
virtual void prepare_stats(td::Promise<std::vector<std::pair<std::string, std::string>>> promise) = 0;
|
||||
|
||||
virtual void prepare_perf_timer_stats(td::Promise<std::vector<PerfTimerStats>> promise) = 0;
|
||||
virtual void add_perf_timer_stat(std::string name, double duration) = 0;
|
||||
};
|
||||
|
||||
} // namespace validator
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue