dogstatsd-ruby 5.0.0 → 5.0.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: f9f9d5b8de35189b467aae9471e7dcbd8a2913bfa94a0ebea428c4088ed1bf6e
4
- data.tar.gz: 5a8ec414ba8e7b97dc5ff2d720b183ae12ce3e8f32dd022889276e02fa852ef2
3
+ metadata.gz: c77f82b5b9a858517a937a5b2db1a1f890a80c94ca63e60f12e256ab28f7192d
4
+ data.tar.gz: e95ee401174c084edb117068f73d1c72f08e602ea9b51363e57e53c176072472
5
5
  SHA512:
6
- metadata.gz: 0a89bc622a5fcb9c5f2376aa0573a3af843b3ce4952505b7d2076ef6f1ee58f6a8d2ef9b2498f919327bae37f05d43970c975a14a654019bef21cf26153d0080
7
- data.tar.gz: 7efd1aaf9d2b4a6795422ad012da1226c43ed3c85aca1242d8c7defee5ef1d1e5decc34d0a5ce767f824cd8f3ad84182ea0b8c56c2fb0e5f0d1bb28b79cc52a8
6
+ metadata.gz: 88d54866c8693d2dab18a1370d6ba5951a42ec4ed62615c6194548dd5faa109731840187e2a7ddaf591f08d07064c8e173df74728f182fe5cb5593c896503e19
7
+ data.tar.gz: d8021d0b6b21efe7ab14841665b01819c397d4419b247615d88b7685b332b1c8bb9a13d05fc22d21baf5d709d5452f9a9a3d932438addfbf1238e8ab5656a8e5
@@ -299,6 +299,26 @@ module Datadog
299
299
  forwarder.send_message(serializer.to_event(title, text, opts))
300
300
  end
301
301
 
302
+ # Send several metrics in the same packet.
303
+ # They will be buffered and flushed when the block finishes.
304
+ #
305
+ # This method exists for compatibility with v4.x versions, it is not needed
306
+ # anymore since the batching is now automatically done internally.
307
+ # It also means that an automatic flush could occur if the buffer is filled
308
+ # during the execution of the batch block.
309
+ #
310
+ # This method is DEPRECATED and will be removed in future v6.x API.
311
+ #
312
+ # @example Send several metrics in one packet:
313
+ # $statsd.batch do |s|
314
+ # s.gauge('users.online',156)
315
+ # s.increment('page.views')
316
+ # end
317
+ def batch
318
+ yield self
319
+ flush(sync: true)
320
+ end
321
+
302
322
  # Close the underlying socket
303
323
  def close
304
324
  forwarder.close
@@ -45,12 +45,18 @@ module Datadog
45
45
 
46
46
  if CLOSEABLE_QUEUES
47
47
  def stop(join_worker: true)
48
+ message_queue = @message_queue
48
49
  message_queue.close if message_queue
50
+
51
+ sender_thread = @sender_thread
49
52
  sender_thread.join if sender_thread && join_worker
50
53
  end
51
54
  else
52
55
  def stop(join_worker: true)
56
+ message_queue = @message_queue
53
57
  message_queue << :close if message_queue
58
+
59
+ sender_thread = @sender_thread
54
60
  sender_thread.join if sender_thread && join_worker
55
61
  end
56
62
  end
@@ -13,7 +13,11 @@ module Datadog
13
13
 
14
14
  # Convert to tag list and set
15
15
  @global_tags = to_tags_list(global_tags)
16
- @global_tags_formatted = @global_tags.join(',') if @global_tags.any?
16
+ if @global_tags.any?
17
+ @global_tags_formatted = @global_tags.join(',')
18
+ else
19
+ @global_tags_formatted = nil
20
+ end
17
21
  end
18
22
 
19
23
  def format(message_tags)
@@ -4,6 +4,6 @@ require_relative 'connection'
4
4
 
5
5
  module Datadog
6
6
  class Statsd
7
- VERSION = '5.0.0'
7
+ VERSION = '5.0.1'
8
8
  end
9
9
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dogstatsd-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.0.0
4
+ version: 5.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rein Henrichs
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2021-04-07 00:00:00.000000000 Z
12
+ date: 2021-04-09 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: A Ruby DogStatsd client
15
15
  email: code@datadoghq.com
@@ -41,9 +41,9 @@ licenses:
41
41
  - MIT
42
42
  metadata:
43
43
  bug_tracker_uri: https://github.com/DataDog/dogstatsd-ruby/issues
44
- changelog_uri: https://github.com/DataDog/dogstatsd-ruby/blob/v5.0.0/CHANGELOG.md
45
- documentation_uri: https://www.rubydoc.info/gems/dogstatsd-ruby/5.0.0
46
- source_code_uri: https://github.com/DataDog/dogstatsd-ruby/tree/v5.0.0
44
+ changelog_uri: https://github.com/DataDog/dogstatsd-ruby/blob/v5.0.1/CHANGELOG.md
45
+ documentation_uri: https://www.rubydoc.info/gems/dogstatsd-ruby/5.0.1
46
+ source_code_uri: https://github.com/DataDog/dogstatsd-ruby/tree/v5.0.1
47
47
  post_install_message:
48
48
  rdoc_options: []
49
49
  require_paths: