dogstatsd-ruby 3.1.0 → 3.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/datadog/statsd.rb +8 -1
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a9743c7a429c0b5932a6f592d55a362582ec6de74fbdca658143e9248c45f2aa
4
- data.tar.gz: 0cd22bc62deaf61fe5af0a26f607f92e347f2068ae5d12045248c5a3bcccc302
3
+ metadata.gz: f51c36199676261f46887363359562998810d87558ee38604dda36313f1a877f
4
+ data.tar.gz: 8294b24d8021e02a2b0ac4e1e85cdd2f0c7ad78ca0b3b61fe7f38302baf1b2ae
5
5
  SHA512:
6
- metadata.gz: e7f35978f04e268613833a79464b827c71a3a0340840621e4b426fca0242a0a718be518ecc64936ed94e16b80a55e3bc40c11eeb21e365565380d9cbbb3d2ab4
7
- data.tar.gz: 9c01c4abeac5f00a8f5eb8936a54c7e09cc903fcafa33115e10a3f9f8fd36e098d7c7d0b0ef5bb2c038eb527ca44011ea304beb8e960f71e3fbc81415db4e5a8
6
+ metadata.gz: a3e82c961fca507847dabb5ca1cd19044dccd23a60aead380d9a7ce6c0b77537b85b0219a9a4a6d1b25242ac63321acb002d5ca88618c0656d706d33ffb5ffe3
7
+ data.tar.gz: ec927e7597a0008cc689fb1d7bdef737cc2c7a0dcf6166b9c39bd1df4e455fbde525cd4269408e800e2ac56fd8563604d27b1015512af69223971f1d23033ad2
@@ -80,7 +80,7 @@ module Datadog
80
80
 
81
81
  # Return the current version of the library.
82
82
  def self.VERSION
83
- "3.1.0"
83
+ "3.2.0"
84
84
  end
85
85
 
86
86
  # @param [String] host your statsd host
@@ -126,6 +126,7 @@ module Datadog
126
126
  # @option opts [Numeric] :by increment value, default 1
127
127
  # @see #count
128
128
  def increment(stat, opts={})
129
+ opts = {:sample_rate => opts} if opts.is_a? Numeric
129
130
  incr_value = opts.fetch(:by, 1)
130
131
  count stat, incr_value, opts
131
132
  end
@@ -139,6 +140,7 @@ module Datadog
139
140
  # @option opts [Numeric] :by decrement value, default 1
140
141
  # @see #count
141
142
  def decrement(stat, opts={})
143
+ opts = {:sample_rate => opts} if opts.is_a? Numeric
142
144
  decr_value = - opts.fetch(:by, 1)
143
145
  count stat, decr_value, opts
144
146
  end
@@ -151,6 +153,7 @@ module Datadog
151
153
  # @option opts [Numeric] :sample_rate sample rate, 1 for always
152
154
  # @option opts [Array<String>] :tags An array of tags
153
155
  def count(stat, count, opts={})
156
+ opts = {:sample_rate => opts} if opts.is_a? Numeric
154
157
  send_stats stat, count, COUNTER_TYPE, opts
155
158
  end
156
159
 
@@ -168,6 +171,7 @@ module Datadog
168
171
  # @example Report the current user count:
169
172
  # $statsd.gauge('user.count', User.count)
170
173
  def gauge(stat, value, opts={})
174
+ opts = {:sample_rate => opts} if opts.is_a? Numeric
171
175
  send_stats stat, value, GAUGE_TYPE, opts
172
176
  end
173
177
 
@@ -195,6 +199,7 @@ module Datadog
195
199
  # @option opts [Numeric] :sample_rate sample rate, 1 for always
196
200
  # @option opts [Array<String>] :tags An array of tags
197
201
  def timing(stat, ms, opts={})
202
+ opts = {:sample_rate => opts} if opts.is_a? Numeric
198
203
  send_stats stat, ms, TIMING_TYPE, opts
199
204
  end
200
205
 
@@ -212,6 +217,7 @@ module Datadog
212
217
  # @example Report the time (in ms) taken to activate an account
213
218
  # $statsd.time('account.activate') { @account.activate! }
214
219
  def time(stat, opts={})
220
+ opts = {:sample_rate => opts} if opts.is_a? Numeric
215
221
  start = Time.now
216
222
  return yield
217
223
  ensure
@@ -227,6 +233,7 @@ module Datadog
227
233
  # @example Record a unique visitory by id:
228
234
  # $statsd.set('visitors.uniques', User.id)
229
235
  def set(stat, value, opts={})
236
+ opts = {:sample_rate => opts} if opts.is_a? Numeric
230
237
  send_stats stat, value, SET_TYPE, opts
231
238
  end
232
239
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dogstatsd-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.0
4
+ version: 3.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rein Henrichs
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-11-23 00:00:00.000000000 Z
11
+ date: 2017-12-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest