mirror of
https://github.com/wg/wrk
synced 2025-02-13 05:52:51 +08:00
start request timer before first write
This commit is contained in:
parent
b8431944ed
commit
a52c770204
13
src/wrk.c
13
src/wrk.c
@ -464,8 +464,12 @@ static void socket_writeable(aeEventLoop *loop, int fd, void *data, int mask) {
|
||||
connection *c = data;
|
||||
thread *thread = c->thread;
|
||||
|
||||
if (!c->written && cfg.dynamic) {
|
||||
script_request(thread->L, &c->request, &c->length);
|
||||
if (!c->written) {
|
||||
if (cfg.dynamic) {
|
||||
script_request(thread->L, &c->request, &c->length);
|
||||
}
|
||||
c->start = time_us();
|
||||
c->pending = cfg.pipeline;
|
||||
}
|
||||
|
||||
char *buf = c->request + c->written;
|
||||
@ -478,11 +482,6 @@ static void socket_writeable(aeEventLoop *loop, int fd, void *data, int mask) {
|
||||
case RETRY: return;
|
||||
}
|
||||
|
||||
if (!c->written) {
|
||||
c->start = time_us();
|
||||
c->pending = cfg.pipeline;
|
||||
}
|
||||
|
||||
c->written += n;
|
||||
if (c->written == c->length) {
|
||||
c->written = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user