|
9 | 9 | #include <cerrno> |
10 | 10 | #include <cstdlib> |
11 | 11 | #include <cstring> |
| 12 | +#include <optional> |
12 | 13 | #include <sys/mman.h> |
13 | 14 | #include <sys/time.h> |
14 | 15 | #include <unistd.h> |
@@ -60,26 +61,31 @@ namespace { |
60 | 61 | [[maybe_unused]] const void *main_thread_stack = nullptr; |
61 | 62 | [[maybe_unused]] size_t main_thread_stacksize = 0; |
62 | 63 |
|
63 | | -void send_slow_net_event_stats(const net_event_t &event, double time_sec) noexcept { |
| 64 | +void send_slow_net_event_stats(const net_event_t& event, double time_sec) noexcept { |
64 | 65 | std::visit(overloaded{ |
65 | | - [&event, time_sec](const net_events_data::rpc_answer &) noexcept { |
66 | | - const auto *rpc_req = get_rpc_request(event.slot_id); |
67 | | - StatsHouseManager::get().add_slow_net_event_stats( |
68 | | - slow_net_event_stats::slow_rpc_response_stats{tl_magic_convert_to_name(rpc_req->function_magic), rpc_req->actor_or_port, time_sec, false}); |
69 | | - }, |
70 | | - [&event, time_sec](const net_events_data::rpc_error &) noexcept { |
71 | | - const auto *rpc_req = get_rpc_request(event.slot_id); |
72 | | - StatsHouseManager::get().add_slow_net_event_stats( |
73 | | - slow_net_event_stats::slow_rpc_response_stats{tl_magic_convert_to_name(rpc_req->function_magic), rpc_req->actor_or_port, time_sec, true}); |
74 | | - }, |
75 | | - [time_sec](const net_events_data::job_worker_answer &jw_answer) noexcept { |
76 | | - if (jw_answer.job_result != nullptr) { |
77 | | - StatsHouseManager::get().add_slow_net_event_stats( |
78 | | - slow_net_event_stats::slow_job_worker_response_stats{jw_answer.job_result->response.get_class(), time_sec}); |
79 | | - } |
80 | | - }, |
81 | | - [](const database_drivers::Response *) {}, |
82 | | - [](const curl_async::CurlResponse *) {}, |
| 66 | + [&event, time_sec](const net_events_data::rpc_answer&) noexcept { |
| 67 | + const auto* rpc_req = get_rpc_request(event.slot_id); |
| 68 | + StatsHouseManager::get().add_slow_net_event_stats(slow_net_event_stats::slow_rpc_response_stats{ |
| 69 | + tl_magic_convert_to_name(rpc_req->function_magic), rpc_req->actor_or_port, time_sec, false}); |
| 70 | + }, |
| 71 | + [&event, time_sec](const net_events_data::rpc_error&) noexcept { |
| 72 | + const auto* rpc_req = get_rpc_request(event.slot_id); |
| 73 | + StatsHouseManager::get().add_slow_net_event_stats(slow_net_event_stats::slow_rpc_response_stats{ |
| 74 | + tl_magic_convert_to_name(rpc_req->function_magic), rpc_req->actor_or_port, time_sec, true}); |
| 75 | + }, |
| 76 | + [time_sec](const net_events_data::job_worker_answer& jw_answer) noexcept { |
| 77 | + if (jw_answer.job_result != nullptr) { |
| 78 | + StatsHouseManager::get().add_slow_net_event_stats( |
| 79 | + slow_net_event_stats::slow_job_worker_response_stats{jw_answer.job_result->response.get_class(), time_sec}); |
| 80 | + } |
| 81 | + }, |
| 82 | + [](const database_drivers::Response*) {}, |
| 83 | + [time_sec](const curl_async::CurlResponse* curl_response) noexcept { |
| 84 | + if (curl_response != nullptr) { |
| 85 | + StatsHouseManager::get().add_slow_net_event_stats(slow_net_event_stats::slow_curl_response_stats{ |
| 86 | + slow_net_event_stats::slow_curl_response_stats::curl_kind::async, std::nullopt, time_sec}); |
| 87 | + } |
| 88 | + }, |
83 | 89 |
|
84 | 90 | }, |
85 | 91 | event.data); |
|
0 commit comments