1 start_server
{tags
{"slowlog"} overrides
{slowlog-log-slower-than
1000000}} {
2 test
{SLOWLOG
- check that it starts with an empty log
} {
6 test
{SLOWLOG
- only logs commands taking more
time than specified
} {
7 r config
set slowlog-log-slower-than
100000
9 assert_equal
[r slowlog len
] 0
11 assert_equal
[r slowlog len
] 1
14 test
{SLOWLOG
- max entries is correctly handled
} {
15 r config
set slowlog-log-slower-than
0
16 r config
set slowlog-max-len
10
17 for {set i
0} {$i < 100} {incr i
} {
23 test
{SLOWLOG
- GET optional argument to limit output len works
} {
24 llength [r slowlog get
5]
27 test
{SLOWLOG
- RESET subcommand works
} {
28 r config
set slowlog-log-slower-than
100000
33 test
{SLOWLOG
- logged
entry sanity check
} {
35 set e
[lindex [r slowlog get
] 0]
36 assert_equal
[llength $e] 4
37 assert_equal
[lindex $e 0] 105
38 assert_equal
[expr {[lindex $e 2] > 100000}] 1
39 assert_equal
[lindex $e 3] {debug sleep
0.2}