From eb165ce430943cc641e135dec7b8f9f7c5503a68 Mon Sep 17 00:00:00 2001 From: Will Date: Sun, 15 Mar 2015 14:08:55 +0900 Subject: [PATCH] prepare wrk 4.0.0 release --- .gitignore | 13 +++++++++++++ CHANGES | 4 ++-- SCRIPTING | 8 ++++---- src/script.c | 6 +++--- src/wrk.h | 2 +- 5 files changed, 23 insertions(+), 10 deletions(-) diff --git a/.gitignore b/.gitignore index fa5044c5..f8548036 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,16 @@ *.o *.a wrk + +deps/luajit/src/host/buildvm +deps/luajit/src/host/buildvm_arch.h +deps/luajit/src/host/minilua +deps/luajit/src/jit/vmdef.lua +deps/luajit/src/lj_bcdef.h +deps/luajit/src/lj_ffdef.h +deps/luajit/src/lj_folddef.h +deps/luajit/src/lj_libdef.h +deps/luajit/src/lj_recdef.h +deps/luajit/src/lj_vm.s +deps/luajit/src/lua/ +deps/luajit/src/luajit diff --git a/CHANGES b/CHANGES index e6c513a7..f44cc15e 100644 --- a/CHANGES +++ b/CHANGES @@ -1,11 +1,11 @@ -wrk next +wrk 4.0.0 * The wrk global variable is the only global defined by default. * wrk.init() calls the global init(), remove calls to wrk.init(). * Add wrk.lookup(host, port) and wrk.connect(addr) functions. * Add setup phase that calls the global setup() for each thread. * Allow assignment to thread.addr to specify the server address. - * Add thread:set(key, value), thread:get(key), and thread:stop(). + * Add thread:set(name, value), thread:get(name), and thread:stop(). * Record latency for every request instead of random samples. * Latency and requests in done() are now callable, not indexable. * Only record timeouts when a response is actually received. diff --git a/SCRIPTING b/SCRIPTING index e6aba350..7e9c3f07 100644 --- a/SCRIPTING +++ b/SCRIPTING @@ -52,10 +52,10 @@ Setup setup() is called once for each thread and receives a userdata object representing the thread. - thread.addr - get or set the thread's server address - thread:get(key) - get the value of a global in the thread's env - thread:set(key, value) - set the value of a global in the thread's env - thread:stop() - stop the thread + thread.addr - get or set the thread's server address + thread:get(name) - get the value of a global in the thread's env + thread:set(name, value) - set the value of a global in the thread's env + thread:stop() - stop the thread Only boolean, nil, number, and string values or tables of the same may be transfered via get()/set() and thread:stop() can only be called while the diff --git a/src/script.c b/src/script.c index f070b206..01043c81 100644 --- a/src/script.c +++ b/src/script.c @@ -60,7 +60,7 @@ lua_State *script_create(char *file, char *url, char **headers) { struct http_parser_url parts = {}; script_parse_url(url, &parts); char *path = "/"; - size_t len; + size_t len = 0; if (parts.field_set & (1 << UF_PATH)) { path = &url[parts.field_data[UF_PATH].off]; @@ -389,9 +389,9 @@ static int script_thread_get(lua_State *L) { static int script_thread_set(lua_State *L) { thread *t = checkthread(L); - const char *key = lua_tostring(L, -2); + const char *name = lua_tostring(L, -2); script_copy_value(L, t->L, -1); - lua_setglobal(t->L, key); + lua_setglobal(t->L, name); return 0; } diff --git a/src/wrk.h b/src/wrk.h index 7d1bba3f..af64ee64 100644 --- a/src/wrk.h +++ b/src/wrk.h @@ -16,7 +16,7 @@ #include "ae.h" #include "http_parser.h" -#define VERSION "3.1.2" +#define VERSION "4.0.0" #define RECVBUF 8192 #define MAX_THREAD_RATE_S 10000000