MCPcopy Create free account
hub / github.com/apache/brpc / AskToBeSampled

Function AskToBeSampled

src/brpc/rpc_dump.h:67–73  ·  view source on GitHub ↗

If this function returns non-NULL, the caller must fill the returned object and submit it for later dumping by calling SubmitSample(). If the caller ignores non-NULL return value, the object is leaked.

Source from the content-addressed store, hash-verified

65// object and submit it for later dumping by calling SubmitSample(). If
66// the caller ignores non-NULL return value, the object is leaked.
67inline SampledRequest* AskToBeSampled() {
68 extern bvar::CollectorSpeedLimit g_rpc_dump_sl;
69 if (!FLAGS_rpc_dump || !bvar::is_collectable(&g_rpc_dump_sl)) {
70 return NULL;
71 }
72 return new (std::nothrow) SampledRequest;
73}
74
75// Read samples from dumped files in a directory.
76// Example:

Callers 5

ProcessHttpRequestFunction · 0.85
ProcessSofaRequestFunction · 0.85
ProcessNsheadRequestFunction · 0.85
ProcessRpcRequestFunction · 0.85
ProcessHuluRequestFunction · 0.85

Calls 1

is_collectableFunction · 0.85

Tested by

no test coverage detected