Module: RSpec::Buildkite::Analytics::Network::NetHTTPPatch

Defined in:
lib/rspec/buildkite/analytics/network.rb

Instance Method Summary collapse

Instance Method Details

#request(request, *args, &block) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/rspec/buildkite/analytics/network.rb', line 6

def request(request, *args, &block)
  unless uri = request.uri
    protocol = use_ssl? ? "https" : "http"
    uri = URI.join("#{protocol}://#{address}:#{port}", request.path)
  end

  detail = { method: request.method.upcase, url: uri.to_s, lib: "net-http" }

  http_tracer = RSpec::Buildkite::Analytics::Uploader.tracer
  http_tracer&.enter("http", **detail)

  super
ensure
  http_tracer&.leave
end