Skip to content
Snippets Groups Projects
Commit 710d58cf authored by Craig Tiller's avatar Craig Tiller
Browse files

Disable profiling in qps_worker for now

parent dba94856
Branches
Tags
No related merge requests found
......@@ -101,6 +101,19 @@ static std::unique_ptr<Server> CreateServer(const ServerConfig& config) {
abort();
}
class ScopedProfile GRPC_FINAL {
public:
ScopedProfile(const char *filename, bool enable) : enable_(enable) {
if (enable_) grpc_profiler_start(filename);
}
~ScopedProfile() {
if (enable_) grpc_profiler_stop();
}
private:
const bool enable_;
};
class WorkerServiceImpl GRPC_FINAL : public WorkerService::Service {
public:
WorkerServiceImpl(int server_port, QpsWorker* worker)
......@@ -114,9 +127,8 @@ class WorkerServiceImpl GRPC_FINAL : public WorkerService::Service {
return Status(StatusCode::RESOURCE_EXHAUSTED, "");
}
grpc_profiler_start("qps_client.prof");
ScopedProfile profile("qps_client.prof", false);
Status ret = RunClientBody(ctx, stream);
grpc_profiler_stop();
return ret;
}
......@@ -128,9 +140,8 @@ class WorkerServiceImpl GRPC_FINAL : public WorkerService::Service {
return Status(StatusCode::RESOURCE_EXHAUSTED, "");
}
grpc_profiler_start("qps_server.prof");
ScopedProfile profile("qps_server.prof", false);
Status ret = RunServerBody(ctx, stream);
grpc_profiler_stop();
return ret;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment