Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Load Testing with Locust

Load Testing with Locust

An introduction to Locust, a modern user-centric load testing tool. Helps you answer the question "How many users will my site handle?". See http://locust.io for more information.

Carl Byström

March 02, 2012
Tweet

Other Decks in Programming

Transcript

  1. def read_all_posts(l): posts = l.client.get("/posts") def index(l): l.client.get("/") for p

    in json.loads(posts.data): if p > 10: l.client.get("/posts/%d" % p) l.wait()
  2. class WebsiteUser(Locust): host = "http://localhost" tasks = [index, read_all_posts] min_wait

    = 2000 max_wait = 5000 def read_all_posts(l): posts = l.client.get("/posts") def index(l): l.client.get("/") for p in json.loads(posts.data): if p > 10: l.client.get("/posts/%d" % p) l.wait()