Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
别团等shy哥发育
redis
提交
5a6948fb
R
redis
项目概览
别团等shy哥发育
/
redis
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
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,发现更多精彩内容 >>
提交
5a6948fb
编写于
3月 24, 2009
作者:
A
antirez
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
random tested mode for test-redis.tcl, minor other stuff, version switched to 0.8
上级
cf3f0c01
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
39 addition
and
40 deletion
+39
-40
.gitignore
.gitignore
+1
-0
TODO
TODO
+2
-31
redis.c
redis.c
+1
-1
test-redis.tcl
test-redis.tcl
+35
-8
未找到文件。
.gitignore
浏览文件 @
5a6948fb
...
...
@@ -5,3 +5,4 @@ redis-server
redis-benchmark
doc-tools
mkrelease.sh
release
TODO
浏览文件 @
5a6948fb
BETA 8 TODO
- Protocol changes as discussed in the Redis group
- keys expire
- sunion ssub
- write integers in a special way on disk (and on memory?)
...
...
@@ -6,33 +6,4 @@ BETA 8 TODO
- network layer stresser in test in demo
- maxclients directive
- check 'server.dirty' everywere
- replication tests
- command line client. If the last argument of a bulk command is missing get it from stdin. Example:
$ echo "bar" | redis-client SET foo
$ redis-client SET foo bar
$ redis-client GET foo
bar
$
- Make Redis aware of the memory it is using thanks to getrusage() and report this info with the INFO command.
- INFO command: clients, slave/master, requests/second in the last N seconds, memory usage, uptime, dirty, lastsave
FUTURE
ROLLBACK command:
ROLLBACK UNSET x
SET x 10
EXPIRE x 3600
COMMIT
(multiple rollbacks are allowed)
or alternatively
TRANSACTION SET x 1000
TRANSACTION EXPIRE x 1000
COMMIT
but this sucks since there is no way to check the error message.
- Prevent the client to issue SYNC or MONITOR multiple times
- replication automated tests
redis.c
浏览文件 @
5a6948fb
...
...
@@ -27,7 +27,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#define REDIS_VERSION "0.0
7
"
#define REDIS_VERSION "0.0
8
"
#include <stdio.h>
#include <stdlib.h>
...
...
test-redis.tcl
浏览文件 @
5a6948fb
...
...
@@ -784,37 +784,37 @@ proc redis_sismember {fd key val} {
}
proc redis_sinter
{
fd args
}
{
redis_writenl $fd
"sinter
[
join $args
]
\r\n
"
redis_writenl $fd
"sinter
[
join $args
]
"
redis_multi_bulk_read $fd
}
proc redis_sinterstore
{
fd args
}
{
redis_writenl $fd
"sinterstore
[
join $args
]
\r\n
"
redis_writenl $fd
"sinterstore
[
join $args
]
"
redis_read_retcode $fd
}
proc redis_smembers
{
fd key
}
{
redis_writenl $fd
"smembers
$key
\r\n
"
redis_writenl $fd
"smembers
$key
"
redis_multi_bulk_read $fd
}
proc redis_echo
{
fd str
}
{
redis_writenl $fd
"echo
[
string length $str
]
\r\n
$str
\r\n
"
redis_writenl $fd
"smembers
$key
\r\n
"
redis_writenl $fd
"echo
[
string length $str
]
\r\n
$str
"
redis_writenl $fd
"smembers
$key
"
}
proc redis_save
{
fd
}
{
redis_writenl $fd
"save
\r\n
"
redis_writenl $fd
"save"
redis_read_retcode $fd
}
proc redis_flushall
{
fd
}
{
redis_writenl $fd
"flushall
\r\n
"
redis_writenl $fd
"flushall"
redis_read_retcode $fd
}
proc redis_flushdb
{
fd
}
{
redis_writenl $fd
"flushdb
\r\n
"
redis_writenl $fd
"flushdb"
redis_read_retcode $fd
}
...
...
@@ -823,8 +823,35 @@ proc redis_lrem {fd key count val} {
redis_read_integer $fd
}
proc stress
{}
{
set fd
[
socket 127.0.0.1 6379
]
fconfigure $fd -translation binary
redis_flushall $fd
while 1
{
set randkey
[
expr int
(
rand
()
*10000
)]
set randval
[
expr int
(
rand
()
*10000
)]
set randidx0
[
expr int
(
rand
()
*10
)]
set randidx1
[
expr int
(
rand
()
*10
)]
set cmd
[
expr int
(
rand
()
*10
)]
if
{
$cmd
== 0
}
{
redis_set $fd $randkey $randval
}
if
{
$cmd
== 1
}
{
redis_get $fd $randkey
}
if
{
$cmd
== 2
}
{
redis_incr $fd $randkey
}
if
{
$cmd
== 3
}
{
redis_lpush $fd $randkey $randval
}
if
{
$cmd
== 4
}
{
redis_rpop $fd $randkey
}
if
{
$cmd
== 5
}
{
redis_del $fd $randkey
}
if
{
$cmd
== 6
}
{
redis_lrange $fd $randkey $randidx0 $randidx1
}
if
{
$cmd
== 7
}
{
redis_ltrim $fd $randkey $randidx0 $randidx1
}
if
{
$cmd
== 8
}
{
redis_lindex $fd $randkey $randidx0
}
if
{
$cmd
== 9
}
{
redis_lset $fd $randkey $randidx0 $randval
}
flush stdout
}
close $fd
}
if
{[
llength $argv
]
== 0
}
{
main 127.0.0.1 6379
}
elseif
{[
llength $argv
]
== 1 &&
[
lindex $argv 0
]
eq
{
stress
}}
{
stress
}
else
{
main
[
lindex $argv 0
]
[
lindex $argv 1
]
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录