aboutsummaryrefslogtreecommitdiffhomepage
path: root/td/telegram/ClientActor.cpp
diff options
context:
space:
mode:
authorArseny Smirnov <arseny30@gmail.com>2020-07-30 17:28:56 +0300
committerArseny Smirnov <arseny30@gmail.com>2020-07-30 17:28:56 +0300
commitcacabaf6d11b29fad7d0ee7199cf8de1b1adc273 (patch)
tree7da3d9463de17563fd3a3bc151a914582d9e773a /td/telegram/ClientActor.cpp
parentd7eadd77c1a6f3cc7429e009ff41402108aa3640 (diff)
NetQueryStats
GitOrigin-RevId: 5a04b322e12e2838b1d7f812fcf06bff4eefbace
Diffstat (limited to 'td/telegram/ClientActor.cpp')
-rw-r--r--td/telegram/ClientActor.cpp19
1 files changed, 15 insertions, 4 deletions
diff --git a/td/telegram/ClientActor.cpp b/td/telegram/ClientActor.cpp
index a53fd7e66..61932e486 100644
--- a/td/telegram/ClientActor.cpp
+++ b/td/telegram/ClientActor.cpp
@@ -9,12 +9,15 @@
#include "td/telegram/td_api.h"
#include "td/telegram/net/NetQueryCounter.h"
+#include "td/telegram/net/NetQueryStats.h"
#include "td/telegram/Td.h"
namespace td {
-ClientActor::ClientActor(unique_ptr<TdCallback> callback) {
- td_ = create_actor<Td>("Td", std::move(callback));
+ClientActor::ClientActor(unique_ptr<TdCallback> callback, Options options) {
+ Td::Options td_options;
+ td_options.net_query_stats = options.net_query_stats;
+ td_ = create_actor<Td>("Td", std::move(callback), std::move(td_options));
}
void ClientActor::request(uint64 id, td_api::object_ptr<td_api::Function> request) {
@@ -31,8 +34,16 @@ td_api::object_ptr<td_api::Object> ClientActor::execute(td_api::object_ptr<td_ap
return Td::static_request(std::move(request));
}
-uint64 get_pending_network_query_count() {
- return NetQueryCounter::get_count();
+std::shared_ptr<NetQueryStats> create_net_query_stats() {
+ return std::make_shared<NetQueryStats>();
+}
+
+void dump_pending_network_queries(NetQueryStats &stats) {
+ stats.dump_pending_network_queries();
+}
+
+uint64 get_pending_network_query_count(NetQueryStats &stats) {
+ return stats.get_count();
}
} // namespace td