Class: SimpleApm::NetHttp
- Inherits:
-
Object
- Object
- SimpleApm::NetHttp
- Defined in:
- lib/simple_apm/net_http.rb
Class Method Summary collapse
Class Method Details
.install ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/simple_apm/net_http.rb', line 4 def install Net::HTTP.class_eval do alias orig_request request unless method_defined?(:orig_request) def request(req, body = nil, &block) url = "http://#{@address}:#{@port}#{req.path}" ActiveSupport::Notifications.instrument "net_http.request", url: url, host: @address, path: req.path do @response = orig_request(req, body, &block) end @response end end end |