Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
bbbf79dd
Commit
bbbf79dd
authored
Jul 01, 2011
by
antirez
Browse files
Added slowlog.tcl
parent
17daf16f
Changes
1
Show whitespace changes
Inline
Side-by-side
tests/unit/slowlog.tcl
0 → 100644
View file @
bbbf79dd
start_server
{
tags
{
"slowlog"
}}
{
test
{
SLOWLOG - check that it starts with an empty log
}
{
r slowlog len
}
{
0
}
test
{
SLOWLOG - only logs commands taking more time than specified
}
{
r config set slowlog-log-slower-than 100000
r ping
assert_equal
[
r slowlog len
]
0
r debug sleep 0.2
assert_equal
[
r slowlog len
]
1
}
test
{
SLOWLOG - max entries is correctly handled
}
{
r config set slowlog-log-slower-than 0
r config set slowlog-max-len 10
for
{
set i 0
}
{
$i
< 100
}
{
incr i
}
{
r ping
}
r slowlog len
}
{
10
}
test
{
SLOWLOG - GET optional argument to limit output len works
}
{
llength
[
r slowlog get 5
]
}
{
5
}
test
{
SLOWLOG - RESET subcommand works
}
{
r config set slowlog-log-slower-than 100000
r slowlog reset
r slowlog len
}
{
0
}
test
{
SLOWLOG - logged entry sanity check
}
{
r debug sleep 0.2
set e
[
lindex
[
r slowlog get
]
0
]
assert_equal
[
llength $e
]
4
assert_equal
[
lindex $e 0
]
105
assert_equal
[
expr
{[
lindex $e 2
]
> 100000
}]
1
assert_equal
[
lindex $e 3
]
{
debug sleep 0.2
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment