Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Branch: master
Pull request Compare This branch is 4 commits ahead of jamesgolick:master.

Login to Rails apps w/ forgery protection enabled

If the @last_response contains a hidden input element with an
authenticity_token, then that token is added to the parameters of the
subsequent POST.
latest commit 6376e74d7c
Wes Gibbs authored
Failed to load latest commit information.
lib Login to Rails apps w/ forgery protection enabled
test Login to Rails apps w/ forgery protection enabled
.gitignore Initial commit to trample.
LICENSE Initial commit to trample.
README.rdoc more edits
Rakefile Initial commit to trample.
VERSION.yml Version bump to 0.1.0
trample.gemspec Will not build with a summary of TODO



Trample is a flexible load simulation tool.

Most load sim tools make requests to a static list of urls. They spawn n threads and make requests to the urls on the list in succession, in each thread. Unfortunately, though, if your applicaition makes use of any kind of caching (including your database's internal caching facilities), this kind of load simulation is unrealistic.

The data required to serve a single set of urls is likely to fit nicely in the database server's cache (even on a small server). So, having a single user hammer a finite set of pages will make your application look much faster than it really is.

Trample allows you to provide parameter values inside of a block (a lambda function, for non-rubyists). The block is executed each time the parameters are needed. So, if you use randomization in the block, you should (theoretically) get different values every time.

That way, you can have trample log in as several different users and request different data in each session.

How To

Trample uses a ruby DSL for configuration.

Trample.configure do
  concurrency 5
  iterations  10
  login do
    post "" do
      {:username => User.random.username, :password => "swordfish"}
  get  ""
  post "" do
    {:a_parameter => "a value"}
  get  "" do
    {:id =>}

The above configuration will start 5 (concurrency) sessions by logging in as a random user at the url in the login block. Then, it'll hit the two urls underneath it 10 (iterations) times during each session.

To run trample, save your configuration somewhere and run:

trample start /path/to/your/trample/config.rb


Copyright © 2009 James Golick. See LICENSE for details.

Something went wrong with that request. Please try again.