newrelic_em_http 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9d22a371cab67537920b39cee9ca725e8834e4dddff7ce05d6eadb2538b40dcd
4
- data.tar.gz: bafd05123128eb9528472301bfd27f7871f714abd7b16a500bf9f1bed37efe13
3
+ metadata.gz: dc07435abe9a9aa46b536d502c969585fc580b365da0309ad31726d1cfce4388
4
+ data.tar.gz: 4c316021428ad2437316b0e60f831b66771ede72fac660e9f9c34de4de648a80
5
5
  SHA512:
6
- metadata.gz: 8b17c49f73d72cb3250a420618c4936fca28794530611c3e3bd537f8e0584145df8cee5bf7390ba19065d6054c019a1d1aa53103feca84ea185e42f26c83d215
7
- data.tar.gz: fe855cc41cd7fb1087c632c9098ad7433ceb12b01e2b5bf0224f6a0eafd2f8e2234a4419e25c78c5b2d4871522a43f35247cd41afcdaa35e03525d7f8e282dba
6
+ metadata.gz: ddfc9d407d9fd91063b0792be516b31cc4b511e2e77ca40c4ea3a26db66eb893b7e609ad10195db678bd6dfbc0e081db1055970325366d9381cc060bf5d9196e
7
+ data.tar.gz: 5755d1fba62fb2b903f4fa60fe25aadb00b0097365beca86a96d73fe8b8c2ef141bf79a0ca7fa3527741b9cd0afa168d380be56a04b68bb5a7abd5c0e88db403
data/CHANGELOG.md ADDED
@@ -0,0 +1,3 @@
1
+ ## v0.0.5
2
+ * Fix issue with tracking persistent (keep-alive) connections
3
+ * Simplify instrumentation by moving it to EM::HttpClient level
@@ -13,43 +13,41 @@ DependencyDetection.defer do
13
13
  end
14
14
 
15
15
  executes do
16
- class EventMachine::HttpConnection
17
- def activate_connection_with_newrelic(client)
18
- wrapped_request = ::NewRelic::Agent::HTTPClients::EmHttpRequest.new(client)
16
+ class EventMachine::HttpClient
17
+ def initialize_with_newrelic(conn, options)
18
+ initialize_without_newrelic(conn, options)
19
19
 
20
- client.newrelic_segment = ::NewRelic::Agent::Tracer.start_external_request_segment(
20
+ wrapped_request = ::NewRelic::Agent::HTTPClients::EmHttpRequest.new(self)
21
+ @newrelic_segment = ::NewRelic::Agent::Tracer.start_external_request_segment(
21
22
  library: wrapped_request.type,
22
23
  uri: wrapped_request.uri,
23
24
  procedure: wrapped_request.method
24
25
  )
25
-
26
- client.callback do
27
- wrapped_response = ::NewRelic::Agent::HTTPClients::EmHttpResponse.new(client)
28
- client.newrelic_segment.read_response_headers wrapped_response
29
- client.newrelic_segment.finish
30
- end
31
-
32
- activate_connection_without_newrelic(client)
33
26
  end
34
27
 
35
- alias_method :activate_connection_without_newrelic, :activate_connection
36
- alias_method :activate_connection, :activate_connection_with_newrelic
37
- end
38
- end
39
-
40
- executes do
41
- class EventMachine::HttpClient
42
- attr_accessor :newrelic_segment
28
+ alias_method :initialize_without_newrelic, :initialize
29
+ alias_method :initialize, :initialize_with_newrelic
43
30
 
44
31
  def send_request_with_newrelic(head, body)
45
32
  wrapped_request = ::NewRelic::Agent::HTTPClients::EmHttpRequest.new(self, head)
46
- newrelic_segment.add_request_headers wrapped_request
33
+ @newrelic_segment.add_request_headers wrapped_request
34
+
47
35
  send_request_without_newrelic(head, body)
48
36
  end
49
37
 
50
38
  alias_method :send_request_without_newrelic, :send_request
51
39
  alias_method :send_request, :send_request_with_newrelic
40
+
41
+ def succeed_with_newrelic(client)
42
+ wrapped_response = ::NewRelic::Agent::HTTPClients::EmHttpResponse.new(self)
43
+ @newrelic_segment.read_response_headers wrapped_response
44
+ @newrelic_segment.finish
45
+
46
+ succeed_without_newrelic(client)
47
+ end
48
+
49
+ alias_method :succeed_without_newrelic, :succeed
50
+ alias_method :succeed, :succeed_with_newrelic
52
51
  end
53
52
  end
54
-
55
53
  end
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = "newrelic_em_http"
7
- spec.version = "0.0.4"
7
+ spec.version = "0.0.5"
8
8
  spec.authors = ["Andriy Yanko"]
9
9
  spec.email = ["andriy.yanko@railsware.com"]
10
10
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: newrelic_em_http
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andriy Yanko
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-04-12 00:00:00.000000000 Z
11
+ date: 2019-07-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: newrelic_rpm
@@ -104,6 +104,7 @@ files:
104
104
  - ".gitignore"
105
105
  - ".rspec"
106
106
  - ".travis.yml"
107
+ - CHANGELOG.md
107
108
  - Gemfile
108
109
  - README.md
109
110
  - Rakefile
@@ -131,8 +132,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
131
132
  - !ruby/object:Gem::Version
132
133
  version: '0'
133
134
  requirements: []
134
- rubyforge_project:
135
- rubygems_version: 2.7.6
135
+ rubygems_version: 3.0.3
136
136
  signing_key:
137
137
  specification_version: 4
138
138
  summary: EM::HTTP instrumentation for New Relic RPM