statsd-instrument 3.1.0 → 3.1.1

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: 3a481f6cd0897b93e3e992fc5315b496c033a98a8cccd02948146cb638e0a6b2
4
- data.tar.gz: ab454f2fecc89aa662ac2f16632fe2fc3c4e4b2b102d3c4058642e5706bf64c1
3
+ metadata.gz: feb99d0537663296eacb1c2f0c6d090f37430afc04d886b60a9aaf322f86a114
4
+ data.tar.gz: 0ed9a90c182d52d11a70490b78c369ba2ec9cdc1b4cf90c86d306199061d5dc9
5
5
  SHA512:
6
- metadata.gz: f3fae39281925135491d66805ff8dada34b0ea798d3403fdf0e6d3b9c1e2d3eda4a78295d7eea046ba7a0db55fb5d357d72e853558f12fdf81c71eff3713c816
7
- data.tar.gz: 852e0838027594b8451d4fb617ca9aa5f614b570c50180bd513fb2986419adf3e9ea4f59ce86e63fbe799ccc3a07720954c87778c9a9dca63cd62fb339906d43
6
+ metadata.gz: bba9e06ddabc9ec50fcc6586f53376d5c5a97ddd1745265d76130544b07ebe603375b964bb1d2ede8e32f03963d098df3bca774873a610cee20fad7df11d537c
7
+ data.tar.gz: b60faf4b9164f883592109a04e64ffb7aaa60972460c26545526c43ad16d2c3ed4a897d9a537a3b285cae4c6435dae8afd96a3303cf7aa2b818afceca65cf17b
data/CHANGELOG.md CHANGED
@@ -8,6 +8,10 @@ section below.
8
8
 
9
9
  _Nothing yet_
10
10
 
11
+ ## Version 3.1.1
12
+
13
+ - Improved flushing of buffered datagrams on process exit when using UDP batching.
14
+
11
15
  ## Version 3.1.0
12
16
 
13
17
  - Introduced UDP batching using a dispatcher thread, and made it the
@@ -71,8 +71,13 @@ module StatsD
71
71
  self
72
72
  end
73
73
 
74
- def shutdown
74
+ def shutdown(wait = @flush_interval * 2)
75
75
  @interrupted = true
76
+ if @dispatcher_thread&.alive?
77
+ @dispatcher_thread.join(wait)
78
+ else
79
+ flush
80
+ end
76
81
  end
77
82
 
78
83
  private
@@ -2,6 +2,6 @@
2
2
 
3
3
  module StatsD
4
4
  module Instrument
5
- VERSION = "3.1.0"
5
+ VERSION = "3.1.1"
6
6
  end
7
7
  end
@@ -69,6 +69,32 @@ module UDPSinkTests
69
69
  pass("Fork is not implemented on #{RUBY_PLATFORM}")
70
70
  end
71
71
 
72
+ def test_sends_datagram_before_exit
73
+ udp_sink = build_sink(@host, @port)
74
+ fork do
75
+ udp_sink << "exiting:1|c"
76
+ Process.exit(0)
77
+ end
78
+
79
+ @receiver.wait_readable(1)
80
+ assert_equal("exiting:1|c", @receiver.recvfrom_nonblock(100).first)
81
+ rescue NotImplementedError
82
+ pass("Fork is not implemented on #{RUBY_PLATFORM}")
83
+ end
84
+
85
+ def test_sends_datagram_when_termed
86
+ udp_sink = build_sink(@host, @port)
87
+ fork do
88
+ udp_sink << "exiting:1|c"
89
+ Process.kill("TERM", Process.pid)
90
+ end
91
+
92
+ @receiver.wait_readable(1)
93
+ assert_equal("exiting:1|c", @receiver.recvfrom_nonblock(100).first)
94
+ rescue NotImplementedError
95
+ pass("Fork is not implemented on #{RUBY_PLATFORM}")
96
+ end
97
+
72
98
  private
73
99
 
74
100
  def build_sink(host = @host, port = @port)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: statsd-instrument
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.0
4
+ version: 3.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jesse Storimer
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2021-04-09 00:00:00.000000000 Z
13
+ date: 2021-04-13 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: concurrent-ruby