| 87 | } |
| 88 | |
| 89 | void HandleEchoResponse( |
| 90 | brpc::Controller* cntl, |
| 91 | test::NotifyResponse* response) { |
| 92 | // std::unique_ptr makes sure cntl/response will be deleted before returning. |
| 93 | std::unique_ptr<brpc::Controller> cntl_guard(cntl); |
| 94 | std::unique_ptr<test::NotifyResponse> response_guard(response); |
| 95 | |
| 96 | if (cntl->Failed() && cntl->ErrorCode() == brpc::ERPCTIMEDOUT) { |
| 97 | g_timeout.fetch_add(1, butil::memory_order_relaxed); |
| 98 | LOG_EVERY_N(INFO, 1000) << cntl->ErrorText(); |
| 99 | } else if (cntl->Failed()) { |
| 100 | g_error.fetch_add(1, butil::memory_order_relaxed); |
| 101 | LOG_EVERY_N(INFO, 1000) << cntl->ErrorText(); |
| 102 | } else { |
| 103 | g_succ.fetch_add(1, butil::memory_order_relaxed); |
| 104 | g_latency_rec << cntl->latency_us(); |
| 105 | } |
| 106 | |
| 107 | } |
| 108 | |
| 109 | void Expose() { |
| 110 | g_timeout_bvar.expose_as("cl", "timeout"); |
nothing calls this directly
no test coverage detected