1
0
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:
Will 2015-01-31 14:54:36 +09:00
parent b8431944ed
commit a52c770204
2 changed files with 7 additions and 8 deletions

View File

@ -464,8 +464,12 @@ static void socket_writeable(aeEventLoop *loop, int fd, void *data, int mask) {
connection *c = data; connection *c = data;
thread *thread = c->thread; thread *thread = c->thread;
if (!c->written && cfg.dynamic) { if (!c->written) {
script_request(thread->L, &c->request, &c->length); 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; 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; case RETRY: return;
} }
if (!c->written) {
c->start = time_us();
c->pending = cfg.pipeline;
}
c->written += n; c->written += n;
if (c->written == c->length) { if (c->written == c->length) {
c->written = 0; c->written = 0;

View File

@ -14,7 +14,7 @@
#include "script.h" #include "script.h"
#include "http_parser.h" #include "http_parser.h"
#define VERSION "3.1.1" #define VERSION "3.1.2"
#define RECVBUF 8192 #define RECVBUF 8192
#define SAMPLES 100000000 #define SAMPLES 100000000