File: profile.rb

package info (click to toggle)
ruby-typhoeus 1.4.0-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 636 kB
  • sloc: ruby: 4,381; makefile: 6
file content (14 lines) | stat: -rw-r--r-- 257 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
require 'typhoeus'
require 'ruby-prof'

calls = 50
base_url = "http://127.0.0.1:3000/"

RubyProf.start
calls.times do |i|
  Typhoeus::Request.get(base_url+i.to_s)
end
result = RubyProf.stop

printer = RubyProf::FlatPrinter.new(result)
printer.print(STDOUT)