Skip to content

Commit

Permalink
prepare wrk 4.0.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
wg committed Mar 15, 2015
1 parent ef6a836 commit eb165ce
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 10 deletions.
13 changes: 13 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -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
4 changes: 2 additions & 2 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
8 changes: 4 additions & 4 deletions SCRIPTING
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions src/script.c
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down Expand Up @@ -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;
}

Expand Down
2 changes: 1 addition & 1 deletion src/wrk.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit eb165ce

Please sign in to comment.