libhoney 1.13.6 → 1.14.0
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/Gemfile.lock +4 -2
- data/lib/libhoney/client.rb +7 -2
- data/lib/libhoney/transmission.rb +12 -7
- data/lib/libhoney/version.rb +1 -1
- data/libhoney.gemspec +1 -0
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: acad70fa5327549aaf1faca4fff6eeab79cdc72e7bab0cd3b6eb44fad49f2333
|
4
|
+
data.tar.gz: 15fb1bdfaa6770ebe836764217a24f7f4410a38096409b7c3c64b775b4116349
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e7a813d6e5b8a0f25f70f3e978a9b9a42e169f62d9b740829e784cf4f92c48531800fc93b69aa8f1aee4f6acebef0f648405db66418ca38e39c46042d02214d8
|
7
|
+
data.tar.gz: 4d764b9c4bfb0b244bb5bf97275730b77c5e70d7720bfeac2cac39ae5d2a858b9fe5ed935379a08ee77a827b29262f787c9fd8ad1ae5ae529efa20fa8a03626e
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
libhoney (1.
|
4
|
+
libhoney (1.14.0)
|
5
5
|
addressable (~> 2.0)
|
6
6
|
http (>= 2.0, < 5.0)
|
7
7
|
|
@@ -61,6 +61,7 @@ GEM
|
|
61
61
|
rack-protection (= 2.0.5)
|
62
62
|
sinatra (= 2.0.5)
|
63
63
|
tilt (>= 1.3, < 3)
|
64
|
+
spy (1.0.0)
|
64
65
|
tilt (2.0.9)
|
65
66
|
unf (0.1.4)
|
66
67
|
unf_ext
|
@@ -86,9 +87,10 @@ DEPENDENCIES
|
|
86
87
|
rubocop (< 0.69)
|
87
88
|
sinatra
|
88
89
|
sinatra-contrib
|
90
|
+
spy
|
89
91
|
webmock (~> 3.4)
|
90
92
|
yard
|
91
93
|
yardstick (~> 0.9)
|
92
94
|
|
93
95
|
BUNDLED WITH
|
94
|
-
1.17.
|
96
|
+
1.17.3
|
data/lib/libhoney/client.rb
CHANGED
@@ -70,6 +70,7 @@ module Libhoney
|
|
70
70
|
# @param block_on_responses [Boolean] if true, block if there is no thread reading from the response queue
|
71
71
|
# @param pending_work_capacity [Fixnum] defaults to 1000. If the queue of
|
72
72
|
# pending events exceeds 1000, this client will start dropping events.
|
73
|
+
# rubocop:disable Metrics/ParameterLists
|
73
74
|
def initialize(writekey: nil,
|
74
75
|
dataset: nil,
|
75
76
|
sample_rate: 1,
|
@@ -81,7 +82,9 @@ module Libhoney
|
|
81
82
|
max_batch_size: 50,
|
82
83
|
send_frequency: 100,
|
83
84
|
max_concurrent_batches: 10,
|
84
|
-
pending_work_capacity: 1000
|
85
|
+
pending_work_capacity: 1000,
|
86
|
+
proxy_config: nil)
|
87
|
+
# rubocop:enable Metrics/ParameterLists
|
85
88
|
# check for insanity
|
86
89
|
raise Exception, 'libhoney: max_concurrent_batches must be greater than 0' if max_concurrent_batches < 1
|
87
90
|
raise Exception, 'libhoney: sample rate must be greater than 0' if sample_rate < 1
|
@@ -118,6 +121,7 @@ module Libhoney
|
|
118
121
|
@pending_work_capacity = pending_work_capacity
|
119
122
|
@responses = SizedQueue.new(2 * @pending_work_capacity)
|
120
123
|
@lock = Mutex.new
|
124
|
+
@proxy_config = proxy_config
|
121
125
|
end
|
122
126
|
|
123
127
|
builder_attr_accessor :writekey, :dataset, :sample_rate, :api_host
|
@@ -221,7 +225,8 @@ module Libhoney
|
|
221
225
|
responses: @responses,
|
222
226
|
block_on_send: @block_on_send,
|
223
227
|
block_on_responses: @block_on_responses,
|
224
|
-
user_agent_addition: @user_agent_addition
|
228
|
+
user_agent_addition: @user_agent_addition,
|
229
|
+
proxy_config: @proxy_config
|
225
230
|
}
|
226
231
|
|
227
232
|
@transmission ||= TransmissionClient.new(transmission_client_params)
|
@@ -13,7 +13,8 @@ module Libhoney
|
|
13
13
|
responses: nil,
|
14
14
|
block_on_send: false,
|
15
15
|
block_on_responses: false,
|
16
|
-
user_agent_addition: nil
|
16
|
+
user_agent_addition: nil,
|
17
|
+
proxy_config: nil)
|
17
18
|
|
18
19
|
@responses = responses || SizedQueue.new(pending_work_capacity * 2)
|
19
20
|
@block_on_send = block_on_send
|
@@ -25,6 +26,7 @@ module Libhoney
|
|
25
26
|
@pending_work_capacity = pending_work_capacity
|
26
27
|
@send_timeout = send_timeout
|
27
28
|
@user_agent = build_user_agent(user_agent_addition).freeze
|
29
|
+
@proxy_config = proxy_config
|
28
30
|
|
29
31
|
@send_queue = Queue.new
|
30
32
|
@threads = []
|
@@ -227,12 +229,15 @@ module Libhoney
|
|
227
229
|
|
228
230
|
def build_http_clients
|
229
231
|
Hash.new do |h, api_host|
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
232
|
+
client = HTTP.timeout(connect: @send_timeout, write: @send_timeout, read: @send_timeout)
|
233
|
+
.persistent(api_host)
|
234
|
+
.headers(
|
235
|
+
'User-Agent' => @user_agent,
|
236
|
+
'Content-Type' => 'application/json'
|
237
|
+
)
|
238
|
+
|
239
|
+
client = client.via(*@proxy_config) unless @proxy_config.nil?
|
240
|
+
h[api_host] = client
|
236
241
|
end
|
237
242
|
end
|
238
243
|
end
|
data/lib/libhoney/version.rb
CHANGED
data/libhoney.gemspec
CHANGED
@@ -29,6 +29,7 @@ Gem::Specification.new do |spec|
|
|
29
29
|
spec.add_development_dependency 'rubocop', '< 0.69'
|
30
30
|
spec.add_development_dependency 'sinatra'
|
31
31
|
spec.add_development_dependency 'sinatra-contrib'
|
32
|
+
spec.add_development_dependency 'spy'
|
32
33
|
spec.add_development_dependency 'webmock', '~> 3.4'
|
33
34
|
spec.add_development_dependency 'yard'
|
34
35
|
spec.add_development_dependency 'yardstick', '~> 0.9'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: libhoney
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.14.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- The Honeycomb.io Team
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-09-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bump
|
@@ -108,6 +108,20 @@ dependencies:
|
|
108
108
|
- - ">="
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: spy
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
111
125
|
- !ruby/object:Gem::Dependency
|
112
126
|
name: webmock
|
113
127
|
requirement: !ruby/object:Gem::Requirement
|