Unverified Commit 4fb39b67 authored by Meir Shpilraien (Spielrein)'s avatar Meir Shpilraien (Spielrein) Committed by GitHub
Browse files

Added module-acquire-GIL latency stats (#9608)

The new value indicates how long Redis wait to
acquire the GIL after sleep. This can help identify
problems where a module perform some background
operation for a long time (with the GIL held) and
blocks the Redis main thread.
parent f5160ed0
...@@ -2973,7 +2973,15 @@ void afterSleep(struct aeEventLoop *eventLoop) { ...@@ -2973,7 +2973,15 @@ void afterSleep(struct aeEventLoop *eventLoop) {
/* Acquire the modules GIL so that their threads won't touch anything. */ /* Acquire the modules GIL so that their threads won't touch anything. */
if (!ProcessingEventsWhileBlocked) { if (!ProcessingEventsWhileBlocked) {
if (moduleCount()) moduleAcquireGIL(); if (moduleCount()) {
mstime_t latency;
latencyStartMonitor(latency);
moduleAcquireGIL();
latencyEndMonitor(latency);
latencyAddSampleIfNeeded("module-acquire-GIL",latency);
}
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment