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
1aa608fc
Commit
1aa608fc
authored
Oct 15, 2010
by
Pieter Noordhuis
Browse files
Change protocol from bulk to inline in redis-benchmark
parent
9da6caac
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/redis-benchmark.c
View file @
1aa608fc
...
@@ -578,7 +578,7 @@ int main(int argc, char **argv) {
...
@@ -578,7 +578,7 @@ int main(int argc, char **argv) {
prepareForBenchmark
(
"SET"
);
prepareForBenchmark
(
"SET"
);
c
=
createClient
();
c
=
createClient
();
if
(
!
c
)
exit
(
1
);
if
(
!
c
)
exit
(
1
);
c
->
obuf
=
sdscat
printf
(
c
->
obuf
,
"SET foo_rand000000000000
%d
\r\n
"
,
config
.
datasize
);
c
->
obuf
=
sdscat
(
c
->
obuf
,
"SET foo_rand000000000000
"
);
{
{
char
*
data
=
zmalloc
(
config
.
datasize
+
2
);
char
*
data
=
zmalloc
(
config
.
datasize
+
2
);
memset
(
data
,
'x'
,
config
.
datasize
);
memset
(
data
,
'x'
,
config
.
datasize
);
...
@@ -612,7 +612,7 @@ int main(int argc, char **argv) {
...
@@ -612,7 +612,7 @@ int main(int argc, char **argv) {
prepareForBenchmark
(
"LPUSH"
);
prepareForBenchmark
(
"LPUSH"
);
c
=
createClient
();
c
=
createClient
();
if
(
!
c
)
exit
(
1
);
if
(
!
c
)
exit
(
1
);
c
->
obuf
=
sdscat
(
c
->
obuf
,
"LPUSH mylist
3
\r\n
bar
\r\n
"
);
c
->
obuf
=
sdscat
(
c
->
obuf
,
"LPUSH mylist bar
\r\n
"
);
prepareClientForReply
(
c
,
REPLY_INT
);
prepareClientForReply
(
c
,
REPLY_INT
);
createMissingClients
(
c
);
createMissingClients
(
c
);
aeMain
(
config
.
el
);
aeMain
(
config
.
el
);
...
@@ -630,7 +630,7 @@ int main(int argc, char **argv) {
...
@@ -630,7 +630,7 @@ int main(int argc, char **argv) {
prepareForBenchmark
(
"SADD"
);
prepareForBenchmark
(
"SADD"
);
c
=
createClient
();
c
=
createClient
();
if
(
!
c
)
exit
(
1
);
if
(
!
c
)
exit
(
1
);
c
->
obuf
=
sdscat
(
c
->
obuf
,
"SADD myset
24
\r\n
counter_rand000000000000
\r\n
"
);
c
->
obuf
=
sdscat
(
c
->
obuf
,
"SADD myset counter_rand000000000000
\r\n
"
);
prepareClientForReply
(
c
,
REPLY_RETCODE
);
prepareClientForReply
(
c
,
REPLY_RETCODE
);
createMissingClients
(
c
);
createMissingClients
(
c
);
aeMain
(
config
.
el
);
aeMain
(
config
.
el
);
...
@@ -648,7 +648,7 @@ int main(int argc, char **argv) {
...
@@ -648,7 +648,7 @@ int main(int argc, char **argv) {
prepareForBenchmark
(
"LPUSH (again, in order to bench LRANGE)"
);
prepareForBenchmark
(
"LPUSH (again, in order to bench LRANGE)"
);
c
=
createClient
();
c
=
createClient
();
if
(
!
c
)
exit
(
1
);
if
(
!
c
)
exit
(
1
);
c
->
obuf
=
sdscat
(
c
->
obuf
,
"LPUSH mylist
3
\r\n
bar
\r\n
"
);
c
->
obuf
=
sdscat
(
c
->
obuf
,
"LPUSH mylist bar
\r\n
"
);
prepareClientForReply
(
c
,
REPLY_RETCODE
);
prepareClientForReply
(
c
,
REPLY_RETCODE
);
createMissingClients
(
c
);
createMissingClients
(
c
);
aeMain
(
config
.
el
);
aeMain
(
config
.
el
);
...
...
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