statsd-instrument 1.7.2 → 2.0.0beta
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.travis.yml +5 -3
- data/Gemfile +1 -4
- data/README.md +97 -29
- data/lib/statsd/instrument/assertions.rb +46 -0
- data/lib/statsd/instrument/backend.rb +10 -0
- data/lib/statsd/instrument/backends/capture_backend.rb +17 -0
- data/lib/statsd/instrument/backends/logger_backend.rb +14 -0
- data/lib/statsd/instrument/backends/null_backend.rb +6 -0
- data/lib/statsd/instrument/backends/udp_backend.rb +88 -0
- data/lib/statsd/instrument/environment.rb +27 -0
- data/lib/statsd/instrument/metric.rb +50 -0
- data/lib/statsd/instrument/version.rb +1 -1
- data/lib/statsd/instrument.rb +19 -86
- data/statsd-instrument.gemspec +2 -1
- data/test/assertions_test.rb +126 -0
- data/test/capture_backend_test.rb +24 -0
- data/test/environment_test.rb +35 -0
- data/test/integration_test.rb +20 -0
- data/test/logger_backend_test.rb +20 -0
- data/test/metric_test.rb +38 -0
- data/test/statsd_instrumentation_test.rb +69 -46
- data/test/statsd_test.rb +56 -220
- data/test/test_helper.rb +5 -3
- data/test/udp_backend_test.rb +135 -0
- metadata +49 -18
data/test/statsd_test.rb
CHANGED
@@ -1,256 +1,92 @@
|
|
1
1
|
require 'test_helper'
|
2
2
|
|
3
|
-
class StatsDTest < Test
|
3
|
+
class StatsDTest < Minitest::Test
|
4
|
+
include StatsD::Instrument::Assertions
|
4
5
|
|
5
|
-
def
|
6
|
-
StatsD.
|
7
|
-
|
8
|
-
UDPSocket.stubs(:new).returns(@socket = mock('socket'))
|
9
|
-
@socket.stubs(:connect)
|
10
|
-
@socket.stubs(:send)
|
11
|
-
StatsD.invalidate_socket
|
12
|
-
|
13
|
-
StatsD.stubs(:logger).returns(@logger = mock('logger'))
|
14
|
-
@logger.stubs(:info)
|
15
|
-
@logger.stubs(:error)
|
6
|
+
def test_statsd_passed_collections_to_backend
|
7
|
+
StatsD.backend.expects(:collect_metric).with(instance_of(StatsD::Instrument::Metric))
|
8
|
+
StatsD.increment('test')
|
16
9
|
end
|
17
10
|
|
18
11
|
def test_statsd_measure_with_explicit_value
|
19
|
-
StatsD.
|
20
|
-
|
12
|
+
metric = capture_statsd_call { StatsD.measure('values.foobar', 42) }
|
13
|
+
assert_equal 'values.foobar', metric.name
|
14
|
+
assert_equal 42, metric.value
|
15
|
+
assert_equal :ms, metric.type
|
21
16
|
end
|
22
17
|
|
23
18
|
def test_statsd_measure_with_explicit_value_and_sample_rate
|
24
|
-
StatsD.
|
25
|
-
|
19
|
+
metric = capture_statsd_call { StatsD.measure('values.foobar', 42, :sample_rate => 0.1) }
|
20
|
+
assert_equal 0.1, metric.sample_rate
|
26
21
|
end
|
27
22
|
|
28
|
-
def
|
23
|
+
def test_statsd_measure_with_benchmarked_duration
|
29
24
|
Benchmark.stubs(:realtime).returns(1.12)
|
30
|
-
|
31
|
-
|
32
|
-
#noop
|
25
|
+
metric = capture_statsd_call do
|
26
|
+
StatsD.measure('values.foobar') { 'foo' }
|
33
27
|
end
|
28
|
+
assert_equal 1120.0, metric.value
|
34
29
|
end
|
35
30
|
|
36
|
-
def
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
31
|
+
def test_statsd_measure_returns_return_value_of_block
|
32
|
+
return_value = StatsD.measure('values.foobar') { 'sarah' }
|
33
|
+
assert_equal 'sarah', return_value
|
34
|
+
end
|
35
|
+
|
36
|
+
def test_statsd_increment
|
37
|
+
metric = capture_statsd_call { StatsD.increment('values.foobar', 3) }
|
38
|
+
assert_equal :c, metric.type
|
39
|
+
assert_equal 'values.foobar', metric.name
|
40
|
+
assert_equal 3, metric.value
|
42
41
|
end
|
43
42
|
|
44
43
|
def test_statsd_increment_with_hash_argument
|
45
|
-
StatsD.
|
46
|
-
StatsD.
|
44
|
+
metric = capture_statsd_call { StatsD.increment('values.foobar', :tags => ['test']) }
|
45
|
+
assert_equal StatsD.default_sample_rate, metric.sample_rate
|
46
|
+
assert_equal ['test'], metric.tags
|
47
|
+
assert_equal 1, metric.value
|
47
48
|
end
|
48
49
|
|
49
50
|
def test_statsd_increment_with_multiple_arguments
|
50
|
-
StatsD.
|
51
|
-
StatsD.
|
51
|
+
metric = capture_statsd_call { StatsD.increment('values.foobar', 12, nil, ['test']) }
|
52
|
+
assert_equal StatsD.default_sample_rate, metric.sample_rate
|
53
|
+
assert_equal ['test'], metric.tags
|
54
|
+
assert_equal 12, metric.value
|
52
55
|
end
|
53
56
|
|
54
57
|
def test_statsd_gauge
|
55
|
-
StatsD.
|
56
|
-
|
58
|
+
metric = capture_statsd_call { StatsD.gauge('values.foobar', 12) }
|
59
|
+
assert_equal :g, metric.type
|
60
|
+
assert_equal 'values.foobar', metric.name
|
61
|
+
assert_equal 12, metric.value
|
57
62
|
end
|
58
63
|
|
59
64
|
def test_statsd_set
|
60
|
-
StatsD.
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
def test_statsd_histogram_on_datadog
|
65
|
-
StatsD.stubs(:implementation).returns(:datadog)
|
66
|
-
StatsD.expects(:collect).with(:h, 'values.hg', 12.33, :sample_rate => 0.2, :tags => ['tag_123', 'key-name:value123'])
|
67
|
-
StatsD.histogram('values.hg', 12.33, :sample_rate => 0.2, :tags => ['tag_123', 'key-name:value123'])
|
68
|
-
end
|
69
|
-
|
70
|
-
def test_raise_when_using_histograms_and_not_on_datadog
|
71
|
-
StatsD.stubs(:implementation).returns(:other)
|
72
|
-
assert_raises(NotImplementedError) { StatsD.histogram('foohg', 3.33) }
|
73
|
-
end
|
74
|
-
|
75
|
-
def test_collect_respects_enabled
|
76
|
-
StatsD.stubs(:enabled).returns(false)
|
77
|
-
StatsD.expects(:write_packet).never
|
78
|
-
StatsD.increment('counter')
|
79
|
-
end
|
80
|
-
|
81
|
-
def test_collect_respects_sampling_rate
|
82
|
-
StatsD.expects(:write_packet).once
|
83
|
-
|
84
|
-
StatsD.stubs(:rand).returns(0.6)
|
85
|
-
StatsD.increment('counter', 1, 0.5)
|
86
|
-
|
87
|
-
StatsD.stubs(:rand).returns(0.4)
|
88
|
-
StatsD.increment('counter', 1, 0.5)
|
89
|
-
end
|
90
|
-
|
91
|
-
def test_support_counter_syntax
|
92
|
-
StatsD.expects(:write_packet).with('counter:1|c')
|
93
|
-
StatsD.increment('counter')
|
94
|
-
|
95
|
-
StatsD.expects(:write_packet).with('counter:10|c|@0.5')
|
96
|
-
StatsD.increment('counter', 10, 0.5)
|
65
|
+
metric = capture_statsd_call { StatsD.set('values.foobar', 'unique_identifier') }
|
66
|
+
assert_equal :s, metric.type
|
67
|
+
assert_equal 'values.foobar', metric.name
|
68
|
+
assert_equal 'unique_identifier', metric.value
|
97
69
|
end
|
98
70
|
|
99
|
-
def
|
100
|
-
StatsD.
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
StatsD.gauge('fooy', 42, 0.01)
|
71
|
+
def test_statsd_histogram
|
72
|
+
metric = capture_statsd_call { StatsD.histogram('values.foobar', 42) }
|
73
|
+
assert_equal :h, metric.type
|
74
|
+
assert_equal 'values.foobar', metric.name
|
75
|
+
assert_equal 42, metric.value
|
105
76
|
end
|
106
77
|
|
107
|
-
def
|
108
|
-
StatsD.
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
StatsD.set('unique', '10.0.0.10', 0.01)
|
78
|
+
def test_statsd_key_value
|
79
|
+
metric = capture_statsd_call { StatsD.key_value('values.foobar', 42) }
|
80
|
+
assert_equal :kv, metric.type
|
81
|
+
assert_equal 'values.foobar', metric.name
|
82
|
+
assert_equal 42, metric.value
|
113
83
|
end
|
114
84
|
|
115
|
-
|
116
|
-
StatsD.expects(:write_packet).with('duration:1.23|ms')
|
117
|
-
StatsD.measure('duration', 1.23)
|
118
|
-
|
119
|
-
StatsD.expects(:write_packet).with('duration:0.42|ms|@0.01')
|
120
|
-
StatsD.measure('duration', 0.42, 0.01)
|
121
|
-
end
|
122
|
-
|
123
|
-
def test_histogram_syntax_on_datadog
|
124
|
-
StatsD.stubs(:implementation).returns(:datadog)
|
125
|
-
|
126
|
-
StatsD.expects(:write_packet).with('fooh:42.4|h')
|
127
|
-
StatsD.histogram('fooh', 42.4)
|
128
|
-
end
|
129
|
-
|
130
|
-
def test_support_tags_syntax_on_datadog
|
131
|
-
StatsD.stubs(:implementation).returns(:datadog)
|
132
|
-
|
133
|
-
StatsD.expects(:write_packet).with("fooc:3|c|#topic:foo,bar")
|
134
|
-
StatsD.increment('fooc', 3, 1.0, ['topic:foo', 'bar'])
|
135
|
-
end
|
136
|
-
|
137
|
-
def test_raise_when_using_tags_and_not_on_datadog
|
138
|
-
StatsD.stubs(:implementation).returns(:other)
|
139
|
-
assert_raises(ArgumentError) { StatsD.increment('fooc', 3, 1.0, ['nonempty']) }
|
140
|
-
end
|
141
|
-
|
142
|
-
def test_rewrite_shitty_tags
|
143
|
-
StatsD.stubs(:implementation).returns(:datadog)
|
144
|
-
|
145
|
-
assert_equal ['igno_red'], StatsD.send(:clean_tags, ['igno,red'])
|
146
|
-
assert_equal ['igno_red'], StatsD.send(:clean_tags, ['igno red'])
|
147
|
-
assert_equal ['test:test_test'], StatsD.send(:clean_tags, ['test:test:test'])
|
148
|
-
|
149
|
-
assert_equal ['tag:value'], StatsD.send(:clean_tags, { :tag => 'value' })
|
150
|
-
assert_equal Set['tag:value', 'tag2:value2'], Set.new(StatsD.send(:clean_tags, { :tag => 'value', :tag2 => 'value2' }))
|
151
|
-
|
152
|
-
StatsD.expects(:write_packet).with("fooc:3|c|#topic:foo_foo,bar_")
|
153
|
-
StatsD.increment('fooc', 3, 1.0, ['topic:foo : foo', 'bar '])
|
154
|
-
|
155
|
-
StatsD.expects(:write_packet).with("foot:1|c|#foo:bar")
|
156
|
-
StatsD.increment('foot', :tags => { :foo => 'bar' })
|
157
|
-
end
|
158
|
-
|
159
|
-
def test_supports_key_value_syntax_on_statsite
|
160
|
-
StatsD.stubs(:implementation).returns(:statsite)
|
161
|
-
|
162
|
-
StatsD.expects(:write_packet).with("fooy:42|kv\n")
|
163
|
-
StatsD.key_value('fooy', 42)
|
164
|
-
end
|
165
|
-
|
166
|
-
def test_supports_key_value_with_timestamp_on_statsite
|
167
|
-
StatsD.stubs(:implementation).returns(:statsite)
|
168
|
-
|
169
|
-
StatsD.expects(:write_packet).with("fooy:42|kv|@123456\n")
|
170
|
-
StatsD.key_value('fooy', 42, 123456)
|
171
|
-
end
|
172
|
-
|
173
|
-
def test_raise_when_using_key_value_and_not_on_statsite
|
174
|
-
StatsD.stubs(:implementation).returns(:other)
|
175
|
-
assert_raises(NotImplementedError) { StatsD.key_value('fookv', 3.33) }
|
176
|
-
end
|
177
|
-
|
178
|
-
def test_support_key_prefix
|
179
|
-
StatsD.expects(:write_packet).with('prefix.counter:1|c').once
|
180
|
-
StatsD.expects(:write_packet).with('counter:1|c').once
|
181
|
-
|
182
|
-
StatsD.stubs(:prefix).returns('prefix')
|
183
|
-
StatsD.increment('counter')
|
184
|
-
StatsD.stubs(:prefix).returns(nil)
|
185
|
-
StatsD.increment('counter')
|
186
|
-
end
|
187
|
-
|
188
|
-
def test_development_mode_uses_logger
|
189
|
-
StatsD.stubs(:mode).returns(:development)
|
190
|
-
|
191
|
-
@logger.expects(:info).with(regexp_matches(/\A\[StatsD\] /))
|
192
|
-
StatsD.increment('counter')
|
193
|
-
end
|
194
|
-
|
195
|
-
def test_production_mode_uses_udp_socket
|
196
|
-
StatsD.stubs(:mode).returns(:production)
|
197
|
-
StatsD.server = "localhost:9815"
|
198
|
-
|
199
|
-
@socket.expects(:connect).with('localhost', 9815).once
|
200
|
-
@socket.expects(:send).with(is_a(String), 0).twice
|
201
|
-
StatsD.increment('counter')
|
202
|
-
StatsD.increment('counter')
|
203
|
-
end
|
204
|
-
|
205
|
-
def test_changing_host_or_port_should_create_new_socket
|
206
|
-
@socket.expects(:connect).with('localhost', 1234).once
|
207
|
-
@socket.expects(:connect).with('localhost', 2345).once
|
208
|
-
@socket.expects(:connect).with('127.0.0.1', 2345).once
|
209
|
-
|
210
|
-
StatsD.server = "localhost:1234"
|
211
|
-
StatsD.send(:socket)
|
212
|
-
|
213
|
-
StatsD.port = 2345
|
214
|
-
StatsD.send(:socket)
|
215
|
-
|
216
|
-
StatsD.host = '127.0.0.1'
|
217
|
-
StatsD.send(:socket)
|
218
|
-
end
|
219
|
-
|
220
|
-
def test_socket_error_should_not_raise_but_log
|
221
|
-
StatsD.stubs(:mode).returns(:production)
|
222
|
-
@socket.stubs(:connect).raises(SocketError)
|
223
|
-
|
224
|
-
@logger.expects(:error).with(instance_of(SocketError))
|
225
|
-
StatsD.measure('values.foobar', 42)
|
226
|
-
end
|
227
|
-
|
228
|
-
def test_system_call_error_should_not_raise_but_log
|
229
|
-
StatsD.stubs(:mode).returns(:production)
|
230
|
-
@socket.stubs(:send).raises(Errno::ETIMEDOUT)
|
231
|
-
|
232
|
-
@logger.expects(:error).with(instance_of(Errno::ETIMEDOUT))
|
233
|
-
StatsD.measure('values.foobar', 42)
|
234
|
-
end
|
235
|
-
|
236
|
-
def test_io_error_should_not_raise_but_log
|
237
|
-
StatsD.stubs(:mode).returns(:production)
|
238
|
-
@socket.stubs(:send).raises(IOError)
|
239
|
-
|
240
|
-
@logger.expects(:error).with(instance_of(IOError))
|
241
|
-
StatsD.measure('values.foobar', 42)
|
242
|
-
end
|
243
|
-
|
244
|
-
def test_live_local_udp_socket
|
245
|
-
UDPSocket.unstub(:new)
|
246
|
-
|
247
|
-
StatsD.stubs(:mode).returns(:production)
|
248
|
-
StatsD.server = "localhost:31798"
|
249
|
-
|
250
|
-
server = UDPSocket.new
|
251
|
-
server.bind('localhost', 31798)
|
85
|
+
protected
|
252
86
|
|
253
|
-
|
254
|
-
|
87
|
+
def capture_statsd_call(&block)
|
88
|
+
metrics = capture_statsd_calls(&block)
|
89
|
+
assert_equal 1, metrics.length
|
90
|
+
metrics.first
|
255
91
|
end
|
256
92
|
end
|
data/test/test_helper.rb
CHANGED
@@ -1,8 +1,10 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
require '
|
1
|
+
ENV['ENV'] = 'test'
|
2
|
+
|
3
|
+
require 'minitest/autorun'
|
4
|
+
require 'minitest/pride'
|
4
5
|
require 'mocha/setup'
|
5
6
|
require 'set'
|
6
7
|
require 'logger'
|
8
|
+
require 'statsd-instrument'
|
7
9
|
|
8
10
|
StatsD.logger = Logger.new('/dev/null')
|
@@ -0,0 +1,135 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
class UDPBackendTest < Minitest::Test
|
4
|
+
def setup
|
5
|
+
StatsD.stubs(:backend).returns(@backend = StatsD::Instrument::Backends::UDPBackend.new)
|
6
|
+
@backend.stubs(:rand).returns(0.0)
|
7
|
+
|
8
|
+
UDPSocket.stubs(:new).returns(@socket = mock('socket'))
|
9
|
+
@socket.stubs(:connect)
|
10
|
+
@socket.stubs(:send).returns(1)
|
11
|
+
|
12
|
+
StatsD.stubs(:logger).returns(@logger = mock('logger'))
|
13
|
+
end
|
14
|
+
|
15
|
+
def test_changing_host_or_port_should_create_new_socket
|
16
|
+
@socket.expects(:connect).with('localhost', 1234).once
|
17
|
+
@socket.expects(:connect).with('localhost', 2345).once
|
18
|
+
@socket.expects(:connect).with('127.0.0.1', 2345).once
|
19
|
+
|
20
|
+
@backend.server = "localhost:1234"
|
21
|
+
@backend.socket
|
22
|
+
|
23
|
+
@backend.port = 2345
|
24
|
+
@backend.socket
|
25
|
+
|
26
|
+
@backend.host = '127.0.0.1'
|
27
|
+
@backend.socket
|
28
|
+
end
|
29
|
+
|
30
|
+
def test_collect_respects_sampling_rate
|
31
|
+
@socket.expects(:send).once.returns(1)
|
32
|
+
metric = StatsD::Instrument::Metric.new(type: :c, name: 'test', sample_rate: 0.5)
|
33
|
+
|
34
|
+
@backend.stubs(:rand).returns(0.4)
|
35
|
+
@backend.collect_metric(metric)
|
36
|
+
|
37
|
+
@backend.stubs(:rand).returns(0.6)
|
38
|
+
@backend.collect_metric(metric)
|
39
|
+
end
|
40
|
+
|
41
|
+
def test_support_counter_syntax
|
42
|
+
@backend.expects(:write_packet).with('counter:1|c').once
|
43
|
+
StatsD.increment('counter', sample_rate: 1.0)
|
44
|
+
|
45
|
+
@backend.expects(:write_packet).with('counter:1|c|@0.5').once
|
46
|
+
StatsD.increment('counter', sample_rate: 0.5)
|
47
|
+
end
|
48
|
+
|
49
|
+
def test_supports_gauge_syntax
|
50
|
+
@backend.expects(:write_packet).with('fooy:1.23|g')
|
51
|
+
StatsD.gauge('fooy', 1.23)
|
52
|
+
|
53
|
+
@backend.expects(:write_packet).with('fooy:42|g|@0.01')
|
54
|
+
StatsD.gauge('fooy', 42, sample_rate: 0.01)
|
55
|
+
end
|
56
|
+
|
57
|
+
def test_supports_set_syntax
|
58
|
+
@backend.expects(:write_packet).with('unique:10.0.0.10|s')
|
59
|
+
StatsD.set('unique', '10.0.0.10')
|
60
|
+
|
61
|
+
@backend.expects(:write_packet).with('unique:10.0.0.10|s|@0.01')
|
62
|
+
StatsD.set('unique', '10.0.0.10', sample_rate: 0.01)
|
63
|
+
end
|
64
|
+
|
65
|
+
def test_support_measure_syntax
|
66
|
+
@backend.expects(:write_packet).with('duration:1.23|ms')
|
67
|
+
StatsD.measure('duration', 1.23)
|
68
|
+
|
69
|
+
@backend.expects(:write_packet).with('duration:0.42|ms|@0.01')
|
70
|
+
StatsD.measure('duration', 0.42, sample_rate: 0.01)
|
71
|
+
end
|
72
|
+
|
73
|
+
def test_histogram_syntax_on_datadog
|
74
|
+
@backend.implementation = :datadog
|
75
|
+
@backend.expects(:write_packet).with('fooh:42.4|h')
|
76
|
+
StatsD.histogram('fooh', 42.4)
|
77
|
+
end
|
78
|
+
|
79
|
+
def test_histogram_warns_if_not_using_datadog
|
80
|
+
@backend.implementation = :other
|
81
|
+
@backend.expects(:write_packet).never
|
82
|
+
@logger.expects(:warn)
|
83
|
+
StatsD.histogram('fooh', 42.4)
|
84
|
+
end
|
85
|
+
|
86
|
+
def test_supports_key_value_syntax_on_statsite
|
87
|
+
@backend.implementation = :statsite
|
88
|
+
@backend.expects(:write_packet).with("fooy:42|kv\n")
|
89
|
+
StatsD.key_value('fooy', 42)
|
90
|
+
end
|
91
|
+
|
92
|
+
def test_supports_key_value_with_timestamp_on_statsite
|
93
|
+
@backend.implementation = :statsite
|
94
|
+
@backend.expects(:write_packet).with("fooy:42|kv|@123456\n")
|
95
|
+
StatsD.key_value('fooy', 42, 123456)
|
96
|
+
end
|
97
|
+
|
98
|
+
def test_warn_when_using_key_value_and_not_on_statsite
|
99
|
+
@backend.implementation = :other
|
100
|
+
@backend.expects(:write_packet).never
|
101
|
+
@logger.expects(:warn)
|
102
|
+
StatsD.key_value('fookv', 3.33)
|
103
|
+
end
|
104
|
+
|
105
|
+
def test_support_tags_syntax_on_datadog
|
106
|
+
@backend.implementation = :datadog
|
107
|
+
@backend.expects(:write_packet).with("fooc:3|c|#topic:foo,bar")
|
108
|
+
StatsD.increment('fooc', 3, tags: ['topic:foo', 'bar'])
|
109
|
+
end
|
110
|
+
|
111
|
+
def test_warn_when_using_tags_and_not_on_datadog
|
112
|
+
@backend.implementation = :other
|
113
|
+
@backend.expects(:write_packet).with("fooc:1|c")
|
114
|
+
@logger.expects(:warn)
|
115
|
+
StatsD.increment('fooc', tags: ['ignored'])
|
116
|
+
end
|
117
|
+
|
118
|
+
def test_socket_error_should_not_raise_but_log
|
119
|
+
@socket.stubs(:connect).raises(SocketError)
|
120
|
+
@logger.expects(:error)
|
121
|
+
StatsD.increment('fail')
|
122
|
+
end
|
123
|
+
|
124
|
+
def test_system_call_error_should_not_raise_but_log
|
125
|
+
@socket.stubs(:send).raises(Errno::ETIMEDOUT)
|
126
|
+
@logger.expects(:error)
|
127
|
+
StatsD.increment('fail')
|
128
|
+
end
|
129
|
+
|
130
|
+
def test_io_error_should_not_raise_but_log
|
131
|
+
@socket.stubs(:send).raises(IOError)
|
132
|
+
@logger.expects(:error)
|
133
|
+
StatsD.increment('fail')
|
134
|
+
end
|
135
|
+
end
|
metadata
CHANGED
@@ -1,8 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: statsd-instrument
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
5
|
-
prerelease:
|
4
|
+
version: 2.0.0beta
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Jesse Storimer
|
@@ -10,38 +9,48 @@ authors:
|
|
10
9
|
autorequire:
|
11
10
|
bindir: bin
|
12
11
|
cert_chain: []
|
13
|
-
date: 2014-
|
12
|
+
date: 2014-04-15 00:00:00.000000000 Z
|
14
13
|
dependencies:
|
15
14
|
- !ruby/object:Gem::Dependency
|
16
15
|
name: rake
|
17
16
|
requirement: !ruby/object:Gem::Requirement
|
18
|
-
none: false
|
19
17
|
requirements:
|
20
|
-
- -
|
18
|
+
- - '>='
|
21
19
|
- !ruby/object:Gem::Version
|
22
20
|
version: '0'
|
23
21
|
type: :development
|
24
22
|
prerelease: false
|
25
23
|
version_requirements: !ruby/object:Gem::Requirement
|
26
|
-
none: false
|
27
24
|
requirements:
|
28
|
-
- -
|
25
|
+
- - '>='
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
version: '0'
|
28
|
+
- !ruby/object:Gem::Dependency
|
29
|
+
name: minitest
|
30
|
+
requirement: !ruby/object:Gem::Requirement
|
31
|
+
requirements:
|
32
|
+
- - '>='
|
33
|
+
- !ruby/object:Gem::Version
|
34
|
+
version: '0'
|
35
|
+
type: :development
|
36
|
+
prerelease: false
|
37
|
+
version_requirements: !ruby/object:Gem::Requirement
|
38
|
+
requirements:
|
39
|
+
- - '>='
|
29
40
|
- !ruby/object:Gem::Version
|
30
41
|
version: '0'
|
31
42
|
- !ruby/object:Gem::Dependency
|
32
43
|
name: mocha
|
33
44
|
requirement: !ruby/object:Gem::Requirement
|
34
|
-
none: false
|
35
45
|
requirements:
|
36
|
-
- -
|
46
|
+
- - '>='
|
37
47
|
- !ruby/object:Gem::Version
|
38
48
|
version: '0'
|
39
49
|
type: :development
|
40
50
|
prerelease: false
|
41
51
|
version_requirements: !ruby/object:Gem::Requirement
|
42
|
-
none: false
|
43
52
|
requirements:
|
44
|
-
- -
|
53
|
+
- - '>='
|
45
54
|
- !ruby/object:Gem::Version
|
46
55
|
version: '0'
|
47
56
|
description: A StatsD client for Ruby appspec. Provides metaprogramming methods to
|
@@ -60,37 +69,59 @@ files:
|
|
60
69
|
- Rakefile
|
61
70
|
- lib/statsd-instrument.rb
|
62
71
|
- lib/statsd/instrument.rb
|
72
|
+
- lib/statsd/instrument/assertions.rb
|
73
|
+
- lib/statsd/instrument/backend.rb
|
74
|
+
- lib/statsd/instrument/backends/capture_backend.rb
|
75
|
+
- lib/statsd/instrument/backends/logger_backend.rb
|
76
|
+
- lib/statsd/instrument/backends/null_backend.rb
|
77
|
+
- lib/statsd/instrument/backends/udp_backend.rb
|
78
|
+
- lib/statsd/instrument/environment.rb
|
79
|
+
- lib/statsd/instrument/metric.rb
|
63
80
|
- lib/statsd/instrument/version.rb
|
64
81
|
- statsd-instrument.gemspec
|
82
|
+
- test/assertions_test.rb
|
83
|
+
- test/capture_backend_test.rb
|
84
|
+
- test/environment_test.rb
|
85
|
+
- test/integration_test.rb
|
86
|
+
- test/logger_backend_test.rb
|
87
|
+
- test/metric_test.rb
|
65
88
|
- test/statsd_instrumentation_test.rb
|
66
89
|
- test/statsd_test.rb
|
67
90
|
- test/test_helper.rb
|
91
|
+
- test/udp_backend_test.rb
|
68
92
|
homepage: https://github.com/Shopify/statsd-instrument
|
69
93
|
licenses:
|
70
94
|
- MIT
|
95
|
+
metadata: {}
|
71
96
|
post_install_message:
|
72
97
|
rdoc_options: []
|
73
98
|
require_paths:
|
74
99
|
- lib
|
75
100
|
required_ruby_version: !ruby/object:Gem::Requirement
|
76
|
-
none: false
|
77
101
|
requirements:
|
78
|
-
- -
|
102
|
+
- - '>='
|
79
103
|
- !ruby/object:Gem::Version
|
80
104
|
version: '0'
|
81
105
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
82
|
-
none: false
|
83
106
|
requirements:
|
84
|
-
- -
|
107
|
+
- - '>'
|
85
108
|
- !ruby/object:Gem::Version
|
86
|
-
version:
|
109
|
+
version: 1.3.1
|
87
110
|
requirements: []
|
88
111
|
rubyforge_project:
|
89
|
-
rubygems_version:
|
112
|
+
rubygems_version: 2.0.3
|
90
113
|
signing_key:
|
91
|
-
specification_version:
|
114
|
+
specification_version: 4
|
92
115
|
summary: A StatsD client for Ruby apps
|
93
116
|
test_files:
|
117
|
+
- test/assertions_test.rb
|
118
|
+
- test/capture_backend_test.rb
|
119
|
+
- test/environment_test.rb
|
120
|
+
- test/integration_test.rb
|
121
|
+
- test/logger_backend_test.rb
|
122
|
+
- test/metric_test.rb
|
94
123
|
- test/statsd_instrumentation_test.rb
|
95
124
|
- test/statsd_test.rb
|
96
125
|
- test/test_helper.rb
|
126
|
+
- test/udp_backend_test.rb
|
127
|
+
has_rdoc:
|