class Object

Constants

CURL_HTTP_HEADER_ARGS
DERAILED_APP
DERAILED_SCRIPT_COUNT
HTTP_HEADERS
HTTP_HEADER_PREFIX
PATH_TO_HIT
RACK_HTTP_HEADERS
TEST_COUNT
TOP_REQUIRE

Top level node that will store all require information for the entire app

WARM_COUNT

Public Instance Methods

call_app(path = File.join("/", PATH_TO_HIT)) click to toggle source
# File lib/derailed_benchmarks/load_tasks.rb, line 105
def call_app(path = File.join("/", PATH_TO_HIT))
  cmd = "curl #{CURL_HTTP_HEADER_ARGS} 'http://localhost:#{@port}#{path}' -s --fail 2>&1"
  response = `#{cmd}`
  unless $?.success?
    STDERR.puts "Couldn't call app."
    STDERR.puts "Bad request to #{cmd.inspect} \n\n***RESPONSE***:\n\n#{ response.inspect }"

    FileUtils.mkdir_p("tmp")
    File.open("tmp/fail.html", "w+") {|f| f.write response.body }

    `open #{File.expand_path("tmp/fail.html")}` if ENV["DERAILED_DEBUG"]

    exit(1)
  end
end
run!(cmd) click to toggle source
# File lib/derailed_benchmarks/tasks.rb, line 287
def run!(cmd)
  out = `#{cmd}`
  raise "Error while running #{cmd.inspect}: #{out}" unless $?.success?
  out
end

Private Instance Methods

require(path) click to toggle source
# File lib/derailed_benchmarks/core_ext/kernel_require.rb, line 77
def require(path)
  Kernel.require(path)
end