inst_statsd 2.4.0 → 3.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: 8b3f7337500a808963c072d5a5f752cdb4c1934bfdbb597fb926bbde54b1ee7f
4
- data.tar.gz: b6375958a56e88a8a0c1ffb766ae8ec31f517071f8032b8ef4947301aac9cbf8
3
+ metadata.gz: 5f261bcd23b66b67672a3e580233639f242393b26faa9060d69ce1876679766c
4
+ data.tar.gz: b79c3e4285dd13e3f0ed06bb78eb4dbde10229ad90e3b5be94afaa75b88493d5
5
5
  SHA512:
6
- metadata.gz: 23d76e604d9a734e6d1f8530ddbf169a0b6f8e429bdcfe6c15b474da4a9ce6d23e1bfcaef2657c7d7bbdb15ab8a33dc633a388712fe6e1900a3b52b132bbdab8
7
- data.tar.gz: eec92096bc95d50b22cc2f2562d71f4843fa31b00578f34c5c46897a4a83f20666ff3dd47ad5be98c0d014c5ee6f533611047f91d0b6e60969c14b01388387f4
6
+ metadata.gz: c4e8b9f646337330232bac47c35fb06d1c72d3eaf530be50c6ef271d256240b154be933f85d52f6fda6203f03d4a1e62fb3e93862c7ec8c1b7cfd309c4b97bc2
7
+ data.tar.gz: 88a89d55b88069d1011c01037f5602af4315de9c95b5b34298263a73c9eda0cec2d6e048aafcdfcfa83a93d87b52ef017d6e96a2863ac4dee864da807105d749
@@ -45,7 +45,7 @@ module InstStatsd
45
45
  if self.instance
46
46
  if Array === stat
47
47
  stat.each do |st|
48
- self.#{method}(st, *args, tags: {}, short_stat: nil)
48
+ self.#{method}(st, *args, tags: tags, short_stat: nil)
49
49
  end
50
50
  return
51
51
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module InstStatsd
4
- VERSION = "2.4.0"
5
- end
4
+ VERSION = "3.0.1"
5
+ end
@@ -95,6 +95,24 @@ describe InstStatsd::Statsd do
95
95
  expect(InstStatsd::Statsd.time('test.name') { 'test' }).to eq 'test'
96
96
  end
97
97
 
98
+ context 'with datadog enabled' do
99
+ it 'handles being called with an array of stat names' do
100
+ converted_tags = %w[tag:value host:]
101
+ statsd = double
102
+ allow(InstStatsd::Statsd).to receive(:instance).and_return(statsd)
103
+ allow(InstStatsd::Statsd).to receive(:append_hostname?).and_return(false)
104
+ allow(InstStatsd::Statsd).to receive(:data_dog?).and_return(true)
105
+ METHODS.each do |method|
106
+ expect(statsd).to receive(method).once.with('test.one', 'value', tags: converted_tags)
107
+ expect(statsd).to receive(method).once.with('test.two', 'value', tags: converted_tags)
108
+ InstStatsd::Statsd.send(method, %w[test.one test.two], 'value', tags: {tag: 'value'}, short_stat: 'short_stat')
109
+ end
110
+ expect(statsd).to receive('timing').once.with('test.one', anything, tags: converted_tags, sample_rate: anything)
111
+ expect(statsd).to receive('timing').once.with('test.two', anything, tags: converted_tags, sample_rate: anything)
112
+ expect(InstStatsd::Statsd.time(%w[test.one test.two], tags: {tag: 'value'}, short_stat: 'short_stat') { 'test' }).to eq 'test'
113
+ end
114
+ end
115
+
98
116
  it "ignores all calls if statsd isn't enabled" do
99
117
  allow(InstStatsd::Statsd).to receive(:instance).and_return(nil)
100
118
  METHODS.each do |method|
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: inst_statsd
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.4.0
4
+ version: 3.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nick Cloward
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2023-06-13 00:00:00.000000000 Z
12
+ date: 2023-07-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: dogstatsd-ruby