Demo code for a talk at Clojure/West 2012 called Load Testing with Clojure. The demo code consists of a simplistic mathematics server built with Compojure and Incanter, some test functions using clojure.test, and Grinder test scripts. The talk slides, mind map, and PDF are in the docs directory.
Setup the project
git clone git://github.com/locopati/load-testing-with-clojure.git
cd load-testing-with-clojure
lein deps # see https://github.com/technomancy/leiningen if you need leiningen
To start the server
lein ring server-headless 9999
To make requests to the server
http://localhost:9999/1%20+%202
(the expression must have spaces around the operator - some browsers will automatically convert a space to %20)
Where is the server code?
src/math/core.clj
test/math/test.clj
To start an agent
bin/grinder agent start [optional number of agents to start - defaults to 1]
To start the console
bin/grinder console start
To run tests
In the Script tab, set the root directory to the $PROJECT_HOME/grinder
Select working.properties and set it as proprties file to use (the star button)
Open working.properties and uncomment the script file to use
Click the play button
In the results tab, you should see test results
Use Pallet to create Grinder agent instances
User Avout to create a concurrent, distributed test source