mirror of
https://codeberg.org/redict/redict.git
synced 2025-01-23 00:28:26 -05:00
f0c5052aa8
This commit enables tracking time of the background tasks and on replies, opening the door for properly tracking commands that rely on blocking / background work via the slowlog, latency history, and commandstats. Some notes: - The time spent blocked waiting for key changes, or blocked on synchronous replication is not accounted for. - **This commit does not affect latency tracking of commands that are non-blocking or do not have background work.** ( meaning that it all stays the same with exception to `BZPOPMIN`,`BZPOPMAX`,`BRPOP`,`BLPOP`, etc... and module's commands that rely on background threads ). - Specifically for latency history command we've added a new event class named `command-unblocking` that will enable latency monitoring on commands that spawn background threads to do the work. - For blocking commands we're now considering the total time of a command as the time spent on call() + the time spent on replying when unblocked. - For Modules commands that rely on background threads we're now considering the total time of a command as the time spent on call (main thread) + the time spent on the background thread ( if marked within `RedisModule_MeasureTimeStart()` and `RedisModule_MeasureTimeEnd()` ) + the time spent on replying (main thread) To test for this feature we've added a `unit/moduleapi/blockonbackground` test that relies on a module that blocks the client and sleeps on the background for a given time. - check blocked command that uses RedisModule_MeasureTimeStart() is tracking background time - check blocked command that uses RedisModule_MeasureTimeStart() is tracking background time even in timeout - check blocked command with multiple calls RedisModule_MeasureTimeStart() is tracking the total background time - check blocked command without calling RedisModule_MeasureTimeStart() is not reporting background time |
||
---|---|---|
.. | ||
moduleapi | ||
type | ||
acl.tcl | ||
aofrw.tcl | ||
auth.tcl | ||
bitfield.tcl | ||
bitops.tcl | ||
dump.tcl | ||
expire.tcl | ||
geo.tcl | ||
hyperloglog.tcl | ||
info.tcl | ||
introspection-2.tcl | ||
introspection.tcl | ||
keyspace.tcl | ||
latency-monitor.tcl | ||
lazyfree.tcl | ||
limits.tcl | ||
maxmemory.tcl | ||
memefficiency.tcl | ||
multi.tcl | ||
obuf-limits.tcl | ||
oom-score-adj.tcl | ||
other.tcl | ||
pause.tcl | ||
pendingquerybuf.tcl | ||
printver.tcl | ||
protocol.tcl | ||
pubsub.tcl | ||
quit.tcl | ||
scan.tcl | ||
scripting.tcl | ||
shutdown.tcl | ||
slowlog.tcl | ||
sort.tcl | ||
tls.tcl | ||
tracking.tcl | ||
wait.tcl |