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
25fd2cb2
Commit
25fd2cb2
authored
Jan 12, 2010
by
antirez
Browse files
a few more stuff in INFO about VM. Test #11 changed a bit in order to be less lame
parent
c953f24b
Changes
3
Show whitespace changes
Inline
Side-by-side
Makefile
View file @
25fd2cb2
...
@@ -3,11 +3,12 @@
...
@@ -3,11 +3,12 @@
# This file is released under the BSD license, see the COPYING file
# This file is released under the BSD license, see the COPYING file
uname_S
:=
$(
shell
sh
-c
'uname -s 2>/dev/null || echo not'
)
uname_S
:=
$(
shell
sh
-c
'uname -s 2>/dev/null || echo not'
)
OPTIMIZATION
?=
-O2
ifeq
($(uname_S),SunOS)
ifeq
($(uname_S),SunOS)
CFLAGS
?=
-std
=
c99
-pedantic
-O2
-Wall
-W
-D__EXTENSIONS__
-D_XPG6
CFLAGS
?=
-std
=
c99
-pedantic
$(OPTIMIZATION)
-Wall
-W
-D__EXTENSIONS__
-D_XPG6
CCLINK
?=
-ldl
-lnsl
-lsocket
-lm
-lpthread
CCLINK
?=
-ldl
-lnsl
-lsocket
-lm
-lpthread
else
else
CFLAGS
?=
-std
=
c99
-pedantic
-O2
-Wall
-W
$(ARCH)
$(PROF)
CFLAGS
?=
-std
=
c99
-pedantic
$(OPTIMIZATION)
-Wall
-W
$(ARCH)
$(PROF)
CCLINK
?=
-lm
-pthread
CCLINK
?=
-lm
-pthread
endif
endif
CCOPT
=
$(CFLAGS)
$(CCLINK)
$(ARCH)
$(PROF)
CCOPT
=
$(CFLAGS)
$(CCLINK)
$(ARCH)
$(PROF)
...
@@ -83,5 +84,8 @@ gprof:
...
@@ -83,5 +84,8 @@ gprof:
gcov
:
gcov
:
make
PROF
=
"-fprofile-arcs -ftest-coverage"
make
PROF
=
"-fprofile-arcs -ftest-coverage"
noopt
:
make
OPTIMIZATION
=
""
32bitgprof
:
32bitgprof
:
make
PROF
=
"-pg"
ARCH
=
"-arch i386"
make
PROF
=
"-pg"
ARCH
=
"-arch i386"
redis.c
View file @
25fd2cb2
...
@@ -2795,6 +2795,8 @@ static int rdbSaveLzfStringObject(FILE *fp, robj *obj) {
...
@@ -2795,6 +2795,8 @@ static int rdbSaveLzfStringObject(FILE *fp, robj *obj) {
outlen
=
sdslen
(
obj
->
ptr
)
-
4
;
outlen
=
sdslen
(
obj
->
ptr
)
-
4
;
if
(
outlen
<=
0
)
return
0
;
if
(
outlen
<=
0
)
return
0
;
if
((
out
=
zmalloc
(
outlen
+
1
))
==
NULL
)
return
0
;
if
((
out
=
zmalloc
(
outlen
+
1
))
==
NULL
)
return
0
;
printf
(
"Calling LZF with ptr: %p
\n
"
,
(
void
*
)
obj
->
ptr
);
fflush
(
stdout
);
comprlen
=
lzf_compress
(
obj
->
ptr
,
sdslen
(
obj
->
ptr
),
out
,
outlen
);
comprlen
=
lzf_compress
(
obj
->
ptr
,
sdslen
(
obj
->
ptr
),
out
,
outlen
);
if
(
comprlen
==
0
)
{
if
(
comprlen
==
0
)
{
zfree
(
out
);
zfree
(
out
);
...
@@ -5615,6 +5617,7 @@ static sds genRedisInfoString(void) {
...
@@ -5615,6 +5617,7 @@ static sds genRedisInfoString(void) {
"vm_stats_io_processing_len:%lu
\r\n
"
"vm_stats_io_processing_len:%lu
\r\n
"
"vm_stats_io_processed_len:%lu
\r\n
"
"vm_stats_io_processed_len:%lu
\r\n
"
"vm_stats_io_waiting_clients:%lu
\r\n
"
"vm_stats_io_waiting_clients:%lu
\r\n
"
"vm_stats_io_active_threads:%lu
\r\n
"
,(
unsigned
long
long
)
server
.
vm_max_memory
,
,(
unsigned
long
long
)
server
.
vm_max_memory
,
(
unsigned
long
long
)
server
.
vm_page_size
,
(
unsigned
long
long
)
server
.
vm_page_size
,
(
unsigned
long
long
)
server
.
vm_pages
,
(
unsigned
long
long
)
server
.
vm_pages
,
...
@@ -5625,7 +5628,8 @@ static sds genRedisInfoString(void) {
...
@@ -5625,7 +5628,8 @@ static sds genRedisInfoString(void) {
(
unsigned
long
)
listLength
(
server
.
io_newjobs
),
(
unsigned
long
)
listLength
(
server
.
io_newjobs
),
(
unsigned
long
)
listLength
(
server
.
io_processing
),
(
unsigned
long
)
listLength
(
server
.
io_processing
),
(
unsigned
long
)
listLength
(
server
.
io_processed
),
(
unsigned
long
)
listLength
(
server
.
io_processed
),
(
unsigned
long
)
listLength
(
server
.
io_clients
)
(
unsigned
long
)
listLength
(
server
.
io_clients
),
(
unsigned
long
)
server
.
io_active_threads
);
);
}
}
for
(
j
=
0
;
j
<
server
.
dbnum
;
j
++
)
{
for
(
j
=
0
;
j
<
server
.
dbnum
;
j
++
)
{
...
...
test-redis.tcl
View file @
25fd2cb2
...
@@ -281,14 +281,19 @@ proc main {server port} {
...
@@ -281,14 +281,19 @@ proc main {server port} {
}
[
string repeat
"abcd"
1000000
]
}
[
string repeat
"abcd"
1000000
]
test
{
SET 10000 numeric keys and access all them in reverse order
}
{
test
{
SET 10000 numeric keys and access all them in reverse order
}
{
set err
{}
for
{
set x 0
}
{
$x
< 10000
}
{
incr x
}
{
for
{
set x 0
}
{
$x
< 10000
}
{
incr x
}
{
$r set $x $x
$r set $x $x
}
}
set sum 0
set sum 0
for
{
set x 9999
}
{
$x
>= 0
}
{
incr x -1
}
{
for
{
set x 9999
}
{
$x
>= 0
}
{
incr x -1
}
{
incr sum
[
$r
get $x
]
set val
[
$r
get $x
]
if
{
$val
ne $x
}
{
set err
"Eleemnt at position
$x
is
$val
instead of
$x
"
break
}
}
format $sum
}
set _ $err
}
{
49995000
}
}
{
49995000
}
test
{
DBSIZE should be 10001 now
}
{
test
{
DBSIZE should be 10001 now
}
{
...
...
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