Skip to content

Commit

Permalink
mcrouter: provide option to enable event base time measurement
Browse files Browse the repository at this point in the history
Summary: This is sometimes useful to debug latency issues in bigcache.

Reviewed By: andreazevedo

Differential Revision: D7004793

fbshipit-source-id: 6f35995223ff1ac8f91581fa32efad785779907d
  • Loading branch information
shodoco authored and facebook-github-bot committed Feb 17, 2018
1 parent 47e845a commit 247fc42
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mcrouter/lib/network/AsyncMcServer.cpp
Expand Up @@ -155,7 +155,7 @@ class McServerThread {
explicit McServerThread(AsyncMcServer& server, size_t id)
: server_(server),
evb_(std::make_unique<folly::EventBase>(
/* enableTimeMeasurement */ false)),
server.opts_.worker.enableEventBaseTimeMeasurement)),
id_(id),
worker_(server.opts_.worker, *evb_),
acceptCallback_(this, false),
Expand All @@ -169,7 +169,7 @@ class McServerThread {
McServerThread(AcceptorT, AsyncMcServer& server, size_t id)
: server_(server),
evb_(std::make_unique<folly::EventBase>(
/* enableTimeMeasurement */ false)),
server.opts_.worker.enableEventBaseTimeMeasurement)),
id_(id),
worker_(server.opts_.worker, *evb_),
acceptCallback_(this, false),
Expand Down
5 changes: 5 additions & 0 deletions mcrouter/lib/network/AsyncMcServerWorkerOptions.h
Expand Up @@ -34,6 +34,11 @@ struct AsyncMcServerWorkerOptions {
*/
bool singleWrite{false};

/**
* If true, time measurement in event base is enabled.
*/
bool enableEventBaseTimeMeasurement{false};

/**
* Maximum number of read system calls per event loop iteration.
* If 0, there is no limit.
Expand Down

0 comments on commit 247fc42

Please sign in to comment.