Skip to content

Commit a52c770

Browse files
committed
start request timer before first write
1 parent b843194 commit a52c770

2 files changed

Lines changed: 7 additions & 8 deletions

File tree

src/wrk.c

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -464,8 +464,12 @@ static void socket_writeable(aeEventLoop *loop, int fd, void *data, int mask) {
464464
connection *c = data;
465465
thread *thread = c->thread;
466466

467-
if (!c->written && cfg.dynamic) {
468-
script_request(thread->L, &c->request, &c->length);
467+
if (!c->written) {
468+
if (cfg.dynamic) {
469+
script_request(thread->L, &c->request, &c->length);
470+
}
471+
c->start = time_us();
472+
c->pending = cfg.pipeline;
469473
}
470474

471475
char *buf = c->request + c->written;
@@ -478,11 +482,6 @@ static void socket_writeable(aeEventLoop *loop, int fd, void *data, int mask) {
478482
case RETRY: return;
479483
}
480484

481-
if (!c->written) {
482-
c->start = time_us();
483-
c->pending = cfg.pipeline;
484-
}
485-
486485
c->written += n;
487486
if (c->written == c->length) {
488487
c->written = 0;

src/wrk.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
#include "script.h"
1515
#include "http_parser.h"
1616

17-
#define VERSION "3.1.1"
17+
#define VERSION "3.1.2"
1818
#define RECVBUF 8192
1919
#define SAMPLES 100000000
2020

0 commit comments

Comments
 (0)