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
e1524f50
Commit
e1524f50
authored
Oct 27, 2014
by
zhanghailei
Committed by
antirez
Dec 11, 2014
Browse files
FIXED redis-benchmark's idle mode.With idle mode shouldn't create write event
parent
94d9482b
Changes
1
Show whitespace changes
Inline
Side-by-side
src/redis-benchmark.c
View file @
e1524f50
...
@@ -392,6 +392,7 @@ static client createClient(char *cmd, size_t len, client from) {
...
@@ -392,6 +392,7 @@ static client createClient(char *cmd, size_t len, client from) {
}
}
}
}
}
}
if
(
config
.
idlemode
==
0
)
aeCreateFileEvent
(
config
.
el
,
c
->
context
->
fd
,
AE_WRITABLE
,
writeHandler
,
c
);
aeCreateFileEvent
(
config
.
el
,
c
->
context
->
fd
,
AE_WRITABLE
,
writeHandler
,
c
);
listAddNodeTail
(
config
.
clients
,
c
);
listAddNodeTail
(
config
.
clients
,
c
);
config
.
liveclients
++
;
config
.
liveclients
++
;
...
@@ -602,8 +603,12 @@ int showThroughput(struct aeEventLoop *eventLoop, long long id, void *clientData
...
@@ -602,8 +603,12 @@ int showThroughput(struct aeEventLoop *eventLoop, long long id, void *clientData
fprintf
(
stderr
,
"All clients disconnected... aborting.
\n
"
);
fprintf
(
stderr
,
"All clients disconnected... aborting.
\n
"
);
exit
(
1
);
exit
(
1
);
}
}
if
(
config
.
csv
)
return
250
;
if
(
config
.
csv
)
return
250
;
if
(
config
.
idlemode
==
1
)
{
printf
(
"clients: %d
\r
"
,
config
.
liveclients
);
fflush
(
stdout
);
return
250
;
}
float
dt
=
(
float
)(
mstime
()
-
config
.
start
)
/
1000
.
0
;
float
dt
=
(
float
)(
mstime
()
-
config
.
start
)
/
1000
.
0
;
float
rps
=
(
float
)
config
.
requests_finished
/
dt
;
float
rps
=
(
float
)
config
.
requests_finished
/
dt
;
printf
(
"%s: %.2f
\r
"
,
config
.
title
,
rps
);
printf
(
"%s: %.2f
\r
"
,
config
.
title
,
rps
);
...
...
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