Skip to content

Commit

Permalink
start request timer before first write
Browse files Browse the repository at this point in the history
  • Loading branch information
wg committed Jan 31, 2015
1 parent b843194 commit a52c770
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
13 changes: 6 additions & 7 deletions src/wrk.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/wrk.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#include "script.h"
#include "http_parser.h"

#define VERSION "3.1.1"
#define VERSION "3.1.2"
#define RECVBUF 8192
#define SAMPLES 100000000

Expand Down

0 comments on commit a52c770

Please sign in to comment.