wg/wrk — pull request #65 by busticated (2014-01-10 02:40:46+00:00)
Title: expose 'WRK_SCRIPT_PATH' global variable to lua scripts

Full disclosure: I'm a newb on multiple fronts here :-)

I am trying to extend wrk using the lua script option to do some basic url setup and configuration - pull urls from a list and load randomly or in sequence, etc. I want to treat these url lists (each representing a typical usage scenario for my app) as simple config data files. The simplest approach seemed to be to use lua's module system... but [unfortunately it isn't that sophisticated when it comes to lookup / pathing](http://stackoverflow.com/q/11714204/579167). Modules are assumed to be available in one of a series of pre-configured directories or, with some work, [relative to the requiring module](http://stackoverflow.com/a/9146653/579167).

The problem is that a program running an embedded script doesn't have a way to set the `...` lua variable (typically, the path used to load the module) when loading and running a script.

So, since wrk knows where to find the user's script, I just expose it as `WRK_SCRIPT_PATH`. Script authors can then use this value to maintain their relative module paths.

All feedback / suggestions welcome! Thanks for making such an awesome tool!