statsd-instrument 2.3.0.beta2 → 2.3.0.beta3

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
  SHA1:
3
- metadata.gz: 3ae635ca926c0f41f78f0662748672144020ff7f
4
- data.tar.gz: 9e9c9023f4d1d874923ee9dd25f968c8110a0d90
3
+ metadata.gz: 4fed77a70470567d6ed49c57a482ca7e7f89dc93
4
+ data.tar.gz: 007f5373e64aa4a4ff2b082430fe4a8f1f65a10d
5
5
  SHA512:
6
- metadata.gz: eca4c77bf05934fcac13b5e43e15d9d8faa1780a1767d4338273c90b60dfb598938647a9c530a01c1bb0cd954acf8460c1d765248843f55000ceed69b545cfae
7
- data.tar.gz: 947142a1db455251acc2cbc9a265f979b46a782d53267d361c3d7cee648b7d53ac9130ca84afa91c24f7a182a72aeb3797fee380eb41d2a8ac8d7e4a264fb769
6
+ metadata.gz: 6f2adb3365c37f6fb8a5abcea906b5f50e6f8cc7be751216680a1dcae0a453ddf39c36ee69066bccb995345b2102f7f68fdbd53284887a3d1d7f32ad46aa5133
7
+ data.tar.gz: 74948e391f080f3706bfb394f120f7eb3d9f9eabe410667257545426711ecef178162f666cd9f97a87365a32e382742a0bd48d0a79459461f4590757c8f7f0fd
@@ -82,7 +82,7 @@ module StatsD
82
82
  def statsd_measure(method, name, *metric_options)
83
83
  add_to_method(method, name, :measure) do
84
84
  define_method(method) do |*args, &block|
85
- StatsD.measure(StatsD::Instrument.generate_metric_name(name, self, *args), nil, *metric_options) { super(*args, &block) }
85
+ StatsD.measure(StatsD::Instrument.generate_metric_name(name, self, *args), *metric_options) { super(*args, &block) }
86
86
  end
87
87
  end
88
88
  end
@@ -1,5 +1,5 @@
1
1
  module StatsD
2
2
  module Instrument
3
- VERSION = "2.3.0.beta2"
3
+ VERSION = "2.3.0.beta3"
4
4
  end
5
5
  end
@@ -225,6 +225,46 @@ class StatsDInstrumentationTest < Minitest::Test
225
225
  ActiveMerchant::Base.statsd_remove_measure :post_with_block, 'ActiveMerchant.Base.post_with_block'
226
226
  end
227
227
 
228
+ def test_statsd_measure_with_value
229
+ ActiveMerchant::UniqueGateway.statsd_measure :ssl_post, 'ActiveMerchant.Gateway.ssl_post', 1
230
+
231
+ assert_statsd_measure('ActiveMerchant.Gateway.ssl_post') do
232
+ ActiveMerchant::UniqueGateway.new.purchase(true)
233
+ end
234
+ ensure
235
+ ActiveMerchant::UniqueGateway.statsd_remove_measure :ssl_post, 'ActiveMerchant.Gateway.ssl_post'
236
+ end
237
+
238
+ def test_statsd_measure_with_value_and_options
239
+ ActiveMerchant::UniqueGateway.statsd_measure :ssl_post, 'ActiveMerchant.Gateway.ssl_post', 1, sample_rate: 0.45
240
+
241
+ assert_statsd_measure('ActiveMerchant.Gateway.ssl_post', sample_rate: 0.45) do
242
+ ActiveMerchant::UniqueGateway.new.purchase(true)
243
+ end
244
+ ensure
245
+ ActiveMerchant::UniqueGateway.statsd_remove_measure :ssl_post, 'ActiveMerchant.Gateway.ssl_post'
246
+ end
247
+
248
+ def test_statsd_measure_with_value_and_distribution
249
+ ActiveMerchant::UniqueGateway.statsd_measure :ssl_post, 'ActiveMerchant.Gateway.ssl_post', 1, as_dist: true
250
+
251
+ assert_statsd_distribution('ActiveMerchant.Gateway.ssl_post') do
252
+ ActiveMerchant::UniqueGateway.new.purchase(true)
253
+ end
254
+ ensure
255
+ ActiveMerchant::UniqueGateway.statsd_remove_measure :ssl_post, 'ActiveMerchant.Gateway.ssl_post'
256
+ end
257
+
258
+ def test_statsd_measure_without_value_as_distribution
259
+ ActiveMerchant::UniqueGateway.statsd_measure :ssl_post, 'ActiveMerchant.Gateway.ssl_post', as_dist: true
260
+
261
+ assert_statsd_distribution('ActiveMerchant.Gateway.ssl_post') do
262
+ ActiveMerchant::UniqueGateway.new.purchase(true)
263
+ end
264
+ ensure
265
+ ActiveMerchant::UniqueGateway.statsd_remove_measure :ssl_post, 'ActiveMerchant.Gateway.ssl_post'
266
+ end
267
+
228
268
  def test_instrumenting_class_method
229
269
  ActiveMerchant::Gateway.singleton_class.extend StatsD::Instrument
230
270
  ActiveMerchant::Gateway.singleton_class.statsd_count :sync, 'ActiveMerchant.Gateway.sync'
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: 2.3.0.beta2
4
+ version: 2.3.0.beta3
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: 2018-06-28 00:00:00.000000000 Z
13
+ date: 2018-07-04 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rake