redict/tests/unit
filipe oliveira f0c5052aa8
Enabled background and reply time tracking on blocked on keys/blocked on background work clients (#7491)
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
2021-01-29 15:38:30 +02:00
..
moduleapi Enabled background and reply time tracking on blocked on keys/blocked on background work clients (#7491) 2021-01-29 15:38:30 +02:00
type Add HRANDFIELD and ZRANDMEMBER. improvements to SRANDMEMBER (#8297) 2021-01-29 10:47:28 +02:00
acl.tcl Fix ACL Pub/Sub test timings (#8122) 2020-12-02 17:24:27 +02:00
aofrw.tcl AOF: run tests with preamble off when it makes sense. 2018-03-25 13:03:38 +02:00
auth.tcl Handle binary safe string for REQUIREPASS and MASTERAUTH directives (#8200) 2020-12-17 09:26:33 -08:00
bitfield.tcl Fix BITFIELD_RO test. 2020-03-23 12:02:12 +01:00
bitops.tcl Regression test for #3282. 2016-06-15 11:49:49 +02:00
dump.tcl Fix recent test failures (#8386) 2021-01-23 21:53:58 +02:00
expire.tcl GETEX, GETDEL and SET PXAT/EXAT (#8327) 2021-01-27 19:47:26 +02:00
geo.tcl GEOSEARCH - ANY option, for limited search that returns ASAP (#8259) 2021-01-08 18:29:44 +02:00
hyperloglog.tcl Squash merging 125 typo/grammar/comment/doc PRs (#7773) 2020-09-10 13:43:38 +03:00
info.tcl Add errorstats info section, Add failed_calls and rejected_calls to commandstats (#8217) 2020-12-31 16:53:43 +02:00
introspection-2.tcl EXISTS should not alter LRU, OBJECT should not reveal expired keys on replica (#8016) 2020-11-18 11:16:21 +02:00
introspection.tcl Add 'set-proc-title' config so that this mechanism can be disabled (#3623) 2021-01-28 11:12:39 +02:00
keyspace.tcl Improve dbid range check for SELECT, MOVE, COPY (#8085) 2020-12-01 21:41:26 +02:00
latency-monitor.tcl Add a --no-latency tests flag. (#7939) 2020-10-22 11:10:53 +03:00
lazyfree.tcl Test: basic lazyfree unit test. 2015-10-09 09:47:17 +02:00
limits.tcl Add io-thread daily CI tests. (#8232) 2021-01-17 15:48:48 +02:00
maxmemory.tcl Improve stability of new CSC eviction test (#8160) 2020-12-08 16:33:09 +02:00
memefficiency.tcl Skip defrag tests on systems with bigger page sizes (#8294) 2021-01-08 10:03:21 +02:00
multi.tcl Swapdb should make transaction fail if there is any client watching keys (#8239) 2021-01-04 14:48:28 +02:00
obuf-limits.tcl Fix new obuf-limits tests to work with TLS (#7848) 2020-09-27 17:13:33 +03:00
oom-score-adj.tcl Fix rare test failures due to repl-ping-replica-period (#8393) 2021-01-25 11:05:25 +02:00
other.tcl Add proc-title-template option. (#8397) 2021-01-28 18:17:39 +02:00
pause.tcl Add io-thread daily CI tests. (#8232) 2021-01-17 15:48:48 +02:00
pendingquerybuf.tcl Slave removal: remove slave from top-level tests descriptions. 2018-09-11 15:32:28 +02:00
printver.tcl Print version info before running the test 2011-05-20 11:44:54 +02:00
protocol.tcl Add io-thread daily CI tests. (#8232) 2021-01-17 15:48:48 +02:00
pubsub.tcl Add io-thread daily CI tests. (#8232) 2021-01-17 15:48:48 +02:00
quit.tcl Add tests for OK on QUIT 2010-10-15 12:54:53 +02:00
scan.tcl Add io-thread daily CI tests. (#8232) 2021-01-17 15:48:48 +02:00
scripting.tcl Add lazyfree-lazy-user-flush config to control default behavior of FLUSH[ALL|DB], SCRIPT FLUSH (#8258) 2021-01-15 15:32:58 +02:00
shutdown.tcl Fix new obuf-limits tests to work with TLS (#7848) 2020-09-27 17:13:33 +03:00
slowlog.tcl Rewritten commands are logged as their original command (#8006) 2020-11-10 13:50:03 -08:00
sort.tcl Config: Add quicklist, remove old list options 2015-01-02 11:16:10 -05:00
tls.tcl TLS: Add different client cert support. (#8076) 2020-12-11 18:31:40 +02:00
tracking.tcl Add io-thread daily CI tests. (#8232) 2021-01-17 15:48:48 +02:00
wait.tcl Add io-thread daily CI tests. (#8232) 2021-01-17 15:48:48 +02:00