I'm working on a blog entry comparing the performance of different templating engines (Smarty, Savant, etc.) and one thing I wanted to do was use http_load to provide data points regarding performance. Trouble is, while http_load kindly provides connection times and first response times means, minimums, and maximums, it doesn't provide a standard deviation. Given that my test environment is a multi-user operating system and other things are running, I am a bit concerned that measurements might contain extra variation because of background processing time.

While not a perfect solution, a good start is getting the standard deviation of measurements. Now, I can compare means with more confidence (ha, ha, a statistics pun) in determining what makes a difference. So, this hack is adding standard deviations to http_load output.

This is a hack in the purest form - namely, it assumes you have at least two responses (two sample points). If http_load does receive only one fetch response, then it will break. It will die. It will explode. It will divide by zero and possibly dump core.

So I won't be contributing this patch upstream unless I decide to put some more work into it, but I find it useful, so you might as well. And now, you'll never have to wonder why my http_load output contains standard deviations.

On my operating system, at least, you'll need to add -lm to LDFLAGS in the Makefile to get this to compile. Have fun!

http_load.c.patch