dogstatsd-ruby 3.1.0 → 3.2.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/lib/datadog/statsd.rb +8 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f51c36199676261f46887363359562998810d87558ee38604dda36313f1a877f
|
4
|
+
data.tar.gz: 8294b24d8021e02a2b0ac4e1e85cdd2f0c7ad78ca0b3b61fe7f38302baf1b2ae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a3e82c961fca507847dabb5ca1cd19044dccd23a60aead380d9a7ce6c0b77537b85b0219a9a4a6d1b25242ac63321acb002d5ca88618c0656d706d33ffb5ffe3
|
7
|
+
data.tar.gz: ec927e7597a0008cc689fb1d7bdef737cc2c7a0dcf6166b9c39bd1df4e455fbde525cd4269408e800e2ac56fd8563604d27b1015512af69223971f1d23033ad2
|
data/lib/datadog/statsd.rb
CHANGED
@@ -80,7 +80,7 @@ module Datadog
|
|
80
80
|
|
81
81
|
# Return the current version of the library.
|
82
82
|
def self.VERSION
|
83
|
-
"3.
|
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.
|
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
|
+
date: 2017-12-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: minitest
|