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 +4 -4
- data/lib/inst_statsd/statsd.rb +1 -1
- data/lib/inst_statsd/version.rb +2 -2
- data/spec/inst_statsd/statsd_spec.rb +18 -0
- 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: 5f261bcd23b66b67672a3e580233639f242393b26faa9060d69ce1876679766c
|
4
|
+
data.tar.gz: b79c3e4285dd13e3f0ed06bb78eb4dbde10229ad90e3b5be94afaa75b88493d5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c4e8b9f646337330232bac47c35fb06d1c72d3eaf530be50c6ef271d256240b154be933f85d52f6fda6203f03d4a1e62fb3e93862c7ec8c1b7cfd309c4b97bc2
|
7
|
+
data.tar.gz: 88a89d55b88069d1011c01037f5602af4315de9c95b5b34298263a73c9eda0cec2d6e048aafcdfcfa83a93d87b52ef017d6e96a2863ac4dee864da807105d749
|
data/lib/inst_statsd/statsd.rb
CHANGED
data/lib/inst_statsd/version.rb
CHANGED
@@ -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:
|
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-
|
12
|
+
date: 2023-07-12 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: dogstatsd-ruby
|