# File lib/bigbench/fragment.rb, line 42 def initialize benchmark, path, method, options = {} @benchmark, @path, @method, @options, @request_options = benchmark, path, method, options, {} @uri = URI(@benchmark.uri.to_s + @path) configure_options end
Initiates the request in the context of a Net::HTTP.start
block
# File lib/bigbench/fragment.rb, line 49 def run! EventMachine::HttpRequest.new(@uri.to_s).send(@method, @request_options) end
Adds the current tracking result as a hash to the benchmark’s tracker
# File lib/bigbench/fragment.rb, line 54 def track!(start, stop, http) @benchmark.tracker.track( { :elapsed => (stop - benchmark.start).to_f, :start => start.to_f, :stop => stop.to_f, :duration => (stop - start).to_milliseconds, :benchmark => @benchmark.name, :url => @uri.to_s, :path => @uri.request_uri, :method => @method, :status => http.response_header.status } ) end