statsd-instrument 3.9.8 → 3.9.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/Gemfile +5 -0
- data/lib/statsd/instrument/connection_behavior.rb +1 -1
- data/lib/statsd/instrument/udp_connection.rb +7 -2
- data/lib/statsd/instrument/version.rb +1 -1
- data/test/udp_sink_test.rb +0 -14
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 60ed39eafdc0c0c60e8b39cc40a525990f7a51c8bf0621bf657558f29e6767c4
|
4
|
+
data.tar.gz: 6d27813cbc21f7f5327cdc261d1dfd7c874d9c4f0c1fdfb17aee1ee63944ea9c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6cafa0a80f7c5d7374d8607698b03fc8eb9fe94cfd7b8a4c6accd1bb9ac4c66a83fea40215df8bcc87c4f729e4379956d2614970539375d13c2cd6d65840a5b9
|
7
|
+
data.tar.gz: 7e254ea3318a5fc3d79bcb648c5cc939dbbb1552f942c67c38f06d698f44659e790489b5a720cca815ca6998a59b317399a3a54350dca61defafc27ed2da15f6
|
data/CHANGELOG.md
CHANGED
@@ -6,6 +6,10 @@ section below.
|
|
6
6
|
|
7
7
|
## Unreleased changes
|
8
8
|
|
9
|
+
## Version 3.9.9
|
10
|
+
|
11
|
+
- [#392](https://github.com/Shopify/statsd-instrument/pull/392) - Prevent ENOBUFS errors when using UDP, by skipping setting socket buffer size.
|
12
|
+
|
9
13
|
## Version 3.9.8
|
10
14
|
|
11
15
|
- [#390](https://github.com/Shopify/statsd-instrument/pull/391) - Fixing bug in Environment when using UDS. The max packet size option was not being passed to the
|
data/Gemfile
CHANGED
@@ -19,4 +19,9 @@ platform :mri do
|
|
19
19
|
if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new("3.2")
|
20
20
|
gem "vernier", require: false
|
21
21
|
end
|
22
|
+
|
23
|
+
# From Ruby >= 3.5, logger is not part of the stdlib anymore
|
24
|
+
if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new("3.5")
|
25
|
+
gem "logger"
|
26
|
+
end
|
22
27
|
end
|
@@ -25,11 +25,16 @@ module StatsD
|
|
25
25
|
|
26
26
|
private
|
27
27
|
|
28
|
+
def setup_socket(original_socket)
|
29
|
+
original_socket
|
30
|
+
end
|
31
|
+
|
28
32
|
def socket
|
29
33
|
@socket ||= begin
|
30
|
-
|
34
|
+
family = Addrinfo.udp(host, port).afamily
|
35
|
+
udp_socket = UDPSocket.new(family)
|
31
36
|
setup_socket(udp_socket)&.tap do |s|
|
32
|
-
s.connect(
|
37
|
+
s.connect(host, port)
|
33
38
|
end
|
34
39
|
end
|
35
40
|
end
|
data/test/udp_sink_test.rb
CHANGED
@@ -151,25 +151,11 @@ class UDPSinkTest < Minitest::Test
|
|
151
151
|
seq = sequence("connect_fail_connect_succeed")
|
152
152
|
|
153
153
|
# First attempt
|
154
|
-
socket.expects(:setsockopt)
|
155
|
-
.with(Socket::SOL_SOCKET, Socket::SO_SNDBUF, StatsD::Instrument::UdpConnection::DEFAULT_MAX_PACKET_SIZE)
|
156
|
-
.in_sequence(seq)
|
157
|
-
socket.expects(:getsockopt)
|
158
|
-
.with(Socket::SOL_SOCKET, Socket::SO_SNDBUF)
|
159
|
-
.returns(mock(int: StatsD::Instrument::UdpConnection::DEFAULT_MAX_PACKET_SIZE))
|
160
|
-
.in_sequence(seq)
|
161
154
|
socket.expects(:connect).with("localhost", 8125).in_sequence(seq)
|
162
155
|
socket.expects(:send).raises(Errno::EDESTADDRREQ).in_sequence(seq)
|
163
156
|
socket.expects(:close).in_sequence(seq)
|
164
157
|
|
165
158
|
# Second attempt after error
|
166
|
-
socket.expects(:setsockopt)
|
167
|
-
.with(Socket::SOL_SOCKET, Socket::SO_SNDBUF, StatsD::Instrument::UdpConnection::DEFAULT_MAX_PACKET_SIZE)
|
168
|
-
.in_sequence(seq)
|
169
|
-
socket.expects(:getsockopt)
|
170
|
-
.with(Socket::SOL_SOCKET, Socket::SO_SNDBUF)
|
171
|
-
.returns(mock(int: StatsD::Instrument::UdpConnection::DEFAULT_MAX_PACKET_SIZE))
|
172
|
-
.in_sequence(seq)
|
173
159
|
socket.expects(:connect).with("localhost", 8125).in_sequence(seq)
|
174
160
|
socket.expects(:send).twice.returns(1).in_sequence(seq)
|
175
161
|
socket.expects(:close).in_sequence(seq)
|
metadata
CHANGED
@@ -1,16 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: statsd-instrument
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.9.
|
4
|
+
version: 3.9.9
|
5
5
|
platform: ruby
|
6
|
-
original_platform: ''
|
7
6
|
authors:
|
8
7
|
- Jesse Storimer
|
9
8
|
- Tobias Lutke
|
10
9
|
- Willem van Bergen
|
11
10
|
bindir: bin
|
12
11
|
cert_chain: []
|
13
|
-
date:
|
12
|
+
date: 2025-01-14 00:00:00.000000000 Z
|
14
13
|
dependencies: []
|
15
14
|
description: A StatsD client for Ruby apps. Provides metaprogramming methods to inject
|
16
15
|
StatsD instrumentation into your code.
|
@@ -131,7 +130,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
131
130
|
- !ruby/object:Gem::Version
|
132
131
|
version: '0'
|
133
132
|
requirements: []
|
134
|
-
rubygems_version: 3.6.
|
133
|
+
rubygems_version: 3.6.2
|
135
134
|
specification_version: 4
|
136
135
|
summary: A StatsD client for Ruby apps
|
137
136
|
test_files:
|