Added module-acquire-GIL latency stats
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.
@@ -2973,7 +2973,15 @@ void afterSleep(struct aeEventLoop *eventLoop) {
/* Acquire the modules GIL so that their threads won't touch anything. */
if (!ProcessingEventsWhileBlocked) {
- if (moduleCount()) moduleAcquireGIL();
+ if (moduleCount()) {
+ mstime_t latency;
+ latencyStartMonitor(latency);
+
+ moduleAcquireGIL();
+
+ latencyEndMonitor(latency);
+ latencyAddSampleIfNeeded("module-acquire-GIL",latency);
+ }
}
}
