Skip to content

Commit

Permalink
Ethon: PR feedback
Browse files Browse the repository at this point in the history
- correct `prepend_instrumentation` comment
- revert `typhoeus?` helper now that only a lone caller remains
  • Loading branch information
fallwith committed Oct 20, 2023
1 parent 40b5fd2 commit 285de8a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
5 changes: 3 additions & 2 deletions lib/new_relic/agent/instrumentation/ethon.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@

executes do
if use_prepend?
# NOTE: to prevent a string like 'Ethon::Easy' from being converted into
# 'Ethon/Easy', a 3rd argument is supplied to `prepend_instrument`
# NOTE: by default prepend_instrument will go with the module name that
# precedes 'Prepend' (so 'Easy' and 'Multi'), but we want to use
# 'Ethon::Easy' and 'Ethon::Multi' so 3rd argument is supplied
prepend_instrument Ethon::Easy, NewRelic::Agent::Instrumentation::Ethon::Easy::Prepend, Ethon::Easy.name
prepend_instrument Ethon::Multi, NewRelic::Agent::Instrumentation::Ethon::Multi::Prepend, Ethon::Multi.name
else
Expand Down
6 changes: 1 addition & 5 deletions test/new_relic/http_client_test_cases.rb
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,7 @@ def test_still_records_tt_node_when_request_fails
# transaction in which the error occurs. That, coupled with the fact that
# fixing it for old versions of Typhoeus would require large changes to
# the instrumentation, makes us say 'meh'.
skip 'Not tested with Typhoeus < 0.5.4' if typhoeus? && Typhoeus::VERSION < '0.5.4'
skip 'Not tested with Typhoeus < 0.5.4' if client_name == 'Typhoeus' && Typhoeus::VERSION < '0.5.4'

evil_server = NewRelic::EvilServer.new
evil_server.start
Expand All @@ -526,10 +526,6 @@ def test_still_records_tt_node_when_request_fails
evil_server.stop
end

def typhoeus?
client_name == 'Typhoeus'
end

def perform_last_node_assertions
last_node = find_last_transaction_node()

Expand Down

0 comments on commit 285de8a

Please sign in to comment.