Skip to content

Commit

Permalink
expose libcurl timings in the faraday env
Browse files Browse the repository at this point in the history
  • Loading branch information
Roguelazer committed Oct 14, 2023
1 parent c1faf4b commit 633d554
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/faraday/adapter/typhoeus.rb
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,10 @@ def request(env)
end
end

env[:typhoeus_timings] = %w[appconnect connect namelookup pretransfer redirect starttransfer total].map do |key|
[key, resp.send("#{key}_time")]
end.to_h

save_response(env, resp.code, resp.body, nil, resp.status_message) do |response_headers|
response_headers.parse resp.response_headers
end
Expand Down

0 comments on commit 633d554

Please sign in to comment.