Skip to content

locopati/load-testing-with-clojure

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

What is this?

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.

Preliminaries

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

The Math Server

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

The Grinder

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

Oh the Places we Could Go

Use Pallet to create Grinder agent instances

User Avout to create a concurrent, distributed test source

About

Talk presented at Clojure/West 2012

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published