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 +4 -4
- data/CHANGES.md +7 -0
- data/http.gemspec +1 -1
- data/lib/http/features/instrumentation.rb +11 -3
- data/lib/http/version.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2545bd2a47ff01e9815c106d0327832fc72362781959a70af0e10b59583b5c25
|
4
|
+
data.tar.gz: 93128cbefb8094cd7338ca7147490a1815e9eea5e1ce36675e3f74b08973e184
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 83062a87b859c3b0dfef82e080dc14d75d462c3d591d8aa151ffdfb458bdda25717262c4aa86b4823271fc00d5c57d771f5a87f5ff5e229057f1d2dd2ea750b2
|
7
|
+
data.tar.gz: 6a7c8ec90698228e156de30ffe02e68ad0105f290582f86e3e7c0664d527f34901ddad7f361a884a9181b6f11694b263f35680c3862231f81c8aaac366f0e517
|
data/CHANGES.md
CHANGED
data/http.gemspec
CHANGED
@@ -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
|
-
|
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
|
-
|
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
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.
|
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
|
+
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: '
|
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: '
|
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.
|
200
|
+
rubygems_version: 3.0.2
|
201
201
|
signing_key:
|
202
202
|
specification_version: 4
|
203
203
|
summary: HTTP should be easy
|