http 4.0.1 → 4.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6b4b0a992f25d4d013ad17cc731ef43b9a77bce5326989ddfcce64e0dac136fc
4
- data.tar.gz: 7db71f7b6038af882c3951c894d38eff1e54642fbd1025644cb2756e6ea3abe9
3
+ metadata.gz: 2545bd2a47ff01e9815c106d0327832fc72362781959a70af0e10b59583b5c25
4
+ data.tar.gz: 93128cbefb8094cd7338ca7147490a1815e9eea5e1ce36675e3f74b08973e184
5
5
  SHA512:
6
- metadata.gz: 1566faa35cdf35dcef2c54cd88c7a9f3768c0e6ed1627e1fbc8af49d0a3b1aab84675bc065a28213f85d43d672779c6778f5dd661b51360116e8bedbc9dc48de
7
- data.tar.gz: 61b6da199935be564e142a2a791374a652bda85ee142384a7d21fa62fbbf6b86167239332f10e67af39a0b719222f216eca3f7390ac72b7f624b95139eb8b852
6
+ metadata.gz: 83062a87b859c3b0dfef82e080dc14d75d462c3d591d8aa151ffdfb458bdda25717262c4aa86b4823271fc00d5c57d771f5a87f5ff5e229057f1d2dd2ea750b2
7
+ data.tar.gz: 6a7c8ec90698228e156de30ffe02e68ad0105f290582f86e3e7c0664d527f34901ddad7f361a884a9181b6f11694b263f35680c3862231f81c8aaac366f0e517
data/CHANGES.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## 4.0.2 (2019-01-15)
2
+
3
+ * [#506](https://github.com/httprb/http/pull/506)
4
+ Fix instrumentation feature.
5
+ ([@paul])
6
+
7
+
1
8
  ## 4.0.1 (2019-01-14)
2
9
 
3
10
  * [#515](https://github.com/httprb/http/pull/515)
data/http.gemspec CHANGED
@@ -32,5 +32,5 @@ Gem::Specification.new do |gem|
32
32
  gem.add_runtime_dependency "http-cookie", "~> 1.0"
33
33
  gem.add_runtime_dependency "addressable", "~> 2.3"
34
34
 
35
- gem.add_development_dependency "bundler", "~> 1.0"
35
+ gem.add_development_dependency "bundler", "~> 2.0"
36
36
  end
@@ -9,10 +9,16 @@ module HTTP
9
9
  # Be sure to specify the instrumenter when enabling the feature:
10
10
  #
11
11
  # HTTP
12
- # .use(instrumentation: {instrumenter: ActiveSupport::Notifications})
12
+ # .use(instrumentation: {instrumenter: ActiveSupport::Notifications.instrumenter})
13
13
  # .get("https://example.com/")
14
14
  #
15
- class Instrumentation
15
+ # Emits two events on every request:
16
+ #
17
+ # * `start_request.http` before the request is made, so you can log the reqest being started
18
+ # * `request.http` after the response is recieved, and contains `start`
19
+ # and `finish` so the duration of the request can be calculated.
20
+ #
21
+ class Instrumentation < Feature
16
22
  attr_reader :instrumenter, :name
17
23
 
18
24
  def initialize(instrumenter: NullInstrumenter.new, namespace: "http")
@@ -21,7 +27,9 @@ module HTTP
21
27
  end
22
28
 
23
29
  def wrap_request(request)
24
- instrumenter.instrument("start_#{name}", :request => request)
30
+ # Emit a separate "start" event, so a logger can print the request
31
+ # being run without waiting for a response
32
+ instrumenter.instrument("start_#{name}", :request => request) {}
25
33
  instrumenter.start(name, :request => request)
26
34
  request
27
35
  end
data/lib/http/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module HTTP
4
- VERSION = "4.0.1"
4
+ VERSION = "4.0.2"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: http
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.1
4
+ version: 4.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tony Arcieri
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2019-01-14 00:00:00.000000000 Z
14
+ date: 2019-01-15 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: http_parser.rb
@@ -75,14 +75,14 @@ dependencies:
75
75
  requirements:
76
76
  - - "~>"
77
77
  - !ruby/object:Gem::Version
78
- version: '1.0'
78
+ version: '2.0'
79
79
  type: :development
80
80
  prerelease: false
81
81
  version_requirements: !ruby/object:Gem::Requirement
82
82
  requirements:
83
83
  - - "~>"
84
84
  - !ruby/object:Gem::Version
85
- version: '1.0'
85
+ version: '2.0'
86
86
  description: An easy-to-use client library for making requests from Ruby. It uses
87
87
  a simple method chaining system for building requests, similar to Python's Requests.
88
88
  email:
@@ -197,7 +197,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
197
197
  - !ruby/object:Gem::Version
198
198
  version: '0'
199
199
  requirements: []
200
- rubygems_version: 3.0.1
200
+ rubygems_version: 3.0.2
201
201
  signing_key:
202
202
  specification_version: 4
203
203
  summary: HTTP should be easy