Lightweight Web Load Testing Tool with Curl and Ruby

จาก Theory Wiki
รุ่นแก้ไขเมื่อ 00:32, 30 มีนาคม 2551 โดย Jittat (คุย | มีส่วนร่วม) (สร้างหน้าใหม่: I have developed a simple web load testing tool using Curl. It is written in Ruby, but you don't have to know much Ruby to use it. First you model your vis...)
(ต่าง) ←รุ่นแก้ไขก่อนหน้า | รุ่นแก้ไขล่าสุด (ต่าง) | รุ่นแก้ไขถัดไป→ (ต่าง)
ไปยังการนำทาง ไปยังการค้นหา

I have developed a simple web load testing tool using Curl. It is written in Ruby, but you don't have to know much Ruby to use it.

First you model your visitors in some file, e.g., load_test.rb:

visitor "Viewer" do
  stores_cookies

  site_url "http://mysite"

  get "/"
  post "/login", {:login => 'guest', :password => 'hello-world'}
  post "/list"
  get "/"
end

visitor "Poster" do
  stores_cookies

  site_url "http://mysite"

  get "/"
  post "/login", {:login => 'user', :password => 'hello'}
  post "/list"
  post "/submit", {
    :image => {:type => :file, :data => 'picture.png'},
    'category' => 58
  }, :multipart => true
end

Then you call

ruby runner.rb load_test Poster 10 Viewer 20 -t 60

which loads your definition, creates 10 Poster and 20 Viewer, and executes them for 60 seconds. After it runs, it'll run and give you some report.