Skip to content

Instantly share code, notes, and snippets.

@wolfoo2931
Last active August 29, 2015 13:57
Show Gist options
  • Save wolfoo2931/9529738 to your computer and use it in GitHub Desktop.
Save wolfoo2931/9529738 to your computer and use it in GitHub Desktop.
module Net
class HTTP
alias_method :old_request, :request
def request(req, body = nil, &block)
start_time = Time.now
result = old_request(req, body, &block)
puts "-"*120
puts "reqeust (#{(Time.now - start_time).round(2)} sec) #{req.method} --> #{self.address}#{req.path}"
#puts caller
return result
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment