postWrite callback occurs after RPC write completes
| 249 | |
| 250 | // postWrite callback occurs after RPC write completes |
| 251 | void RpcEventHandler::postWrite(void* ctx, const char* fn_name, uint32_t bytes) { |
| 252 | InvocationContext* rpc_ctx = reinterpret_cast<InvocationContext*>(ctx); |
| 253 | rpc_ctx->write_end_us = GetMonoTimeMicros(); |
| 254 | const int64_t elapsed_time = rpc_ctx->write_end_us - rpc_ctx->start_time_us; |
| 255 | const int64_t write_time = rpc_ctx->write_end_us - rpc_ctx->write_start_us; |
| 256 | const string& call_name = string(fn_name); |
| 257 | // TODO: bytes is always 0 since TTransport does not track write count. |
| 258 | VLOG(vlog_level_) << "RPC call: " << server_name_ << ":" << call_name << " from " |
| 259 | << TNetworkAddressToString(rpc_ctx->cnxn_ctx->network_address) |
| 260 | << " took " |
| 261 | << PrettyPrinter::Print(elapsed_time * 1000L, TUnit::TIME_NS); |
| 262 | MethodDescriptor* descriptor = rpc_ctx->method_descriptor; |
| 263 | descriptor->num_in_flight.Add(-1); |
| 264 | descriptor->processing_time_distribution->Update(elapsed_time); |
| 265 | descriptor->write_time_distribution->Update(write_time); |
| 266 | } |
| 267 | |
| 268 | // preRead callback occurs before RPC read starts |
| 269 | void RpcEventHandler::preRead(void* ctx, const char* fn_name) { |
nothing calls this directly
no test coverage detected