15 #ifndef IMPALA_RPC_RPC_TRACE_H
16 #define IMPALA_RPC_RPC_TRACE_H
22 #include <thrift/TProcessor.h>
23 #include <boost/thread/thread.hpp>
24 #include <boost/unordered_map.hpp>
26 #include <rapidjson/document.h>
48 virtual void postWrite(
void* ctx,
const char* fn_name, uint32_t bytes);
67 void ToJson(rapidjson::Value* server, rapidjson::Document* document);
70 void Reset(
const std::string& method_name);
91 typedef boost::unordered_map<std::string, MethodDescriptor*>
MethodMap;
InvocationContext(int64_t start_time, const ThriftServer::ConnectionContext *cnxn_ctx, MethodDescriptor *descriptor)
boost::mutex method_map_lock_
Protects method_map_ and rpc_counter_.
MetricGroup * metrics_
Metrics subsystem access.
MetricGroups may be organised hierarchically as a tree.
const ThriftServer::ConnectionContext * cnxn_ctx
void ResetAll()
Resets the statistics for all methods.
void Reset(const std::string &method_name)
Resets the statistics for a single method.
std::string server_name_
Name of the server that we listen for events from.
Created per-Rpc invocation.
Per-connection information.
void InitRpcEventTracing(Webserver *webserver)
Initialises rpc event tracing, must be called before any RpcEventHandlers are created.
std::string name
Name of the method.
virtual void * getContext(const char *fn_name, void *server_context)
StatsMetric< double > * time_stats
Summary statistics for the time taken to respond to this method.
void ToJson(rapidjson::Value *server, rapidjson::Document *document)
const int64_t start_time_ms
Monotonic milliseconds (typically boot time) when the call started.
virtual void postWrite(void *ctx, const char *fn_name, uint32_t bytes)
MethodMap method_map_
Map of all methods, populated lazily as they are invoked for the first time.
boost::unordered_map< std::string, MethodDescriptor * > MethodMap
Map from method name to descriptor.
std::string server_name() const
MethodDescriptor * method_descriptor
Pointer to parent MethodDescriptor, to save a lookup on deletion.
AtomicInt< uint32_t > num_in_flight
Number of invocations in flight.
RpcEventHandler(const std::string &server_name, MetricGroup *metrics)