Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xindoo
redis
提交
9f080a01
R
redis
项目概览
xindoo
/
redis
通知
2
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
redis
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
9f080a01
编写于
11月 04, 2011
作者:
A
antirez
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
first version of the speed regression test
上级
7b86f5e6
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
85 addition
and
0 deletion
+85
-0
utils/speed-regression.tcl
utils/speed-regression.tcl
+85
-0
未找到文件。
utils/speed-regression.tcl
0 → 100755
浏览文件 @
9f080a01
#!/usr/bin/env tclsh8.5
# Copyright
(
C
)
2011 Salvatore Sanfilippo
# Released under the BSD license like Redis itself
proc run-tests branches
{
set runs
{}
set branch_id 0
foreach b $branches
{
cd ../src
puts
"Benchmarking
$b
"
exec -ignorestderr git checkout $b 2> /dev/null
exec -ignorestderr make clean 2> /dev/null
puts
" compiling..."
exec -ignorestderr make 2> /dev/null
if
{
$branch
_id == 0
}
{
puts
" copy redis-benchmark from unstable to /tmp..."
exec -ignorestderr cp ./redis-benchmark /tmp
incr branch_id
continue
}
# Start the Redis server
puts
" starting the server...
[
exec ./redis-server -v
]
"
set pids
[
exec echo
"port 12123
\n
loglevel warning
\n
"
| ./redis-server - > /dev/null 2> /dev/null &
]
after 1000
puts
" running the benchmark"
set output
[
exec /tmp/redis-benchmark -n 100000 --csv -p 12123
]
lappend runs $b $output
puts
" killing server..."
catch
{
exec kill -9
[
lindex $pids 0
]
exec kill -9
[
lindex $pids 1
]
}
incr branch_id
}
return $runs
}
proc get-result-with-name
{
output name
}
{
foreach line
[
split $output
"
\n
"
]
{
lassign
[
split $line
","
]
key value
set key
[
string tolower
[
string range $key 1 end-1
]]
set value
[
string range $value 1 end-1
]
if
{
$key
eq
[
string tolower $name
]}
{
return $value
}
}
return
"n/a"
}
proc combine-results
{
results
}
{
set tests
{
ping set get incr lpush lpop sadd spop
"lrange (first 100 elements)"
"lrange (first 600 elements)"
"mset (10 keys)"
}
foreach test $tests
{
puts $test
foreach
{
branch output
}
$results
{
puts
[
format
"%-20s %s"
\
$branch
[
get-result-with-name $output $test
]]
}
puts
{}
}
}
proc main
{}
{
# Note: the first branch is only used in order to get the redis-benchmark
# executable. Tests are performed starting from the second branch.
set branches
{
slowset 2.2.0 2.4.0 unstable slowset
}
set results
[
run-tests $branches
]
puts
[
combine-results $results
]
}
# Force the user to run the script from the 'utils' directory.
if
{
!
[
file exists speed-regression.tcl
]}
{
puts
"Please make sure to run speed-regression.tcl while inside /utils."
puts
"Example: cd utils; ./speed-regression.tcl"
exit 1
}
main
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录