MCPcopy Create free account
hub / github.com/apache/impala / postWrite

Method postWrite

be/src/rpc/rpc-trace.cc:251–266  ·  view source on GitHub ↗

postWrite callback occurs after RPC write completes

Source from the content-addressed store, hash-verified

249
250// postWrite callback occurs after RPC write completes
251void 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
269void RpcEventHandler::preRead(void* ctx, const char* fn_name) {

Callers

nothing calls this directly

Calls 4

GetMonoTimeMicrosFunction · 0.85
TNetworkAddressToStringFunction · 0.85
AddMethod · 0.45
UpdateMethod · 0.45

Tested by

no test coverage detected