statsd-instrument 4.0.1 → 4.1.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c7184b3fb0852d7afea02fa71a292812ef26b491eb94ab2427f603b49f01202c
4
- data.tar.gz: e40e7aa3d4cb034467b6d59fdfdb3bcbf55a2901e82c48368fd1e904d0aa67c5
3
+ metadata.gz: b823f54e400ae4601e27f794788499896555a0d6cd6aec04fe35b95202b870d2
4
+ data.tar.gz: ae4db5a2b0bcd24d62ece908a60d5bf4e4cc9aee3812ee286bccb31d00edd3d7
5
5
  SHA512:
6
- metadata.gz: e1d01801fcbedc88df3e57bf948e6a4b599b52365e80d55e66ced52d4b308427632d5dc8161614705a7524e9a7f1b56e85e717ef9e3f0509969091b801ec30c2
7
- data.tar.gz: 97bf3cf218ef6be51d72dc96f067464cc8f21eb0b070be9e48d7097cc4863735f41a58a3ed6967829524b6df64af1d8a1122197fec46944ce8154dcf539a4721
6
+ metadata.gz: 635ac1cbb333c0e82e96fee3e224ceeb2795621b8137c4fca5a5065c2664899857f054c8e5c18e09f32aeace847b470a6613664c917e343972bbc26461688fd1
7
+ data.tar.gz: cd510fb973122ac97b7978649a0fd4ec806e371dd202589c710a58ff8de58d582c6fa8b3ef85b8295c944cc9072926b7552a081a003b75943320bd7ec1819152
data/.github/CODEOWNERS CHANGED
@@ -1 +1 @@
1
- * @wvanbergen
1
+ * @Shopify/statsd-instrument-write
@@ -5,7 +5,7 @@ on: push
5
5
  jobs:
6
6
  test:
7
7
  name: Send metric over UDP
8
- runs-on: ubuntu-latest
8
+ runs-on: ubuntu-22.04
9
9
 
10
10
  steps:
11
11
  - uses: actions/checkout@v4
@@ -5,7 +5,7 @@ on: push
5
5
  jobs:
6
6
  test:
7
7
  name: Rubocop
8
- runs-on: ubuntu-latest
8
+ runs-on: ubuntu-22.04
9
9
 
10
10
  steps:
11
11
  - uses: actions/checkout@v4
data/CHANGELOG.md CHANGED
@@ -6,6 +6,14 @@ section below.
6
6
 
7
7
  ## Unreleased changes
8
8
 
9
+ ## Version 4.1.0
10
+
11
+ - [#430](https://github.com/Shopify/statsd-instrument/pull/430) - Add an opt-in mode that skips the tag sort during aggregation, for StatsD servers that combine metrics with the same
12
+ tags in a different order. Set `STATSD_AGGREGATION_SORT_TAGS=false` or pass `aggregation_sort_tags: false` to
13
+ `Client.new`. Tags are still sorted by default.
14
+ - [#430](https://github.com/Shopify/statsd-instrument/pull/430) - Use `Symbol#name` for Symbol keys and values of hash tags where Ruby provides it (Ruby 3.0 and later), so the
15
+ datagram builder does not allocate a copy of each one.
16
+
9
17
  ## Version 4.0.1
10
18
 
11
19
  - Normalize ASCII whitespace in metric names and prefixes, and newlines (`\n` and `\r`) in tags and set values, including aggregated and compiled metrics.
data/README.md CHANGED
@@ -105,12 +105,50 @@ To enable metric aggregation, set the following environment variables:
105
105
  - `STATSD_ENABLE_AGGREGATION`: Set this to `true` to enable the experimental aggregation feature. Aggregation is disabled by default.
106
106
  - `STATSD_AGGREGATION_INTERVAL`: Specifies the interval (in seconds) at which aggregated metrics are flushed and sent to the StatsD server.
107
107
  For example, setting this to `2` will aggregate and send metrics every 2 seconds. Two seconds is also the default value if this environment variable is not set.
108
+ - `STATSD_AGGREGATION_SORT_TAGS`: Set this to `false` to skip the tag sort during aggregation. Tags are sorted by default.
109
+ See [Skipping the tag sort](#skipping-the-tag-sort).
108
110
 
109
111
  Please note that since aggregation is an experimental feature, it should be used with caution in production environments.
110
112
 
111
113
  > [!WARNING]
112
114
  > This feature is only compatible with Datadog Agent's version >=6.25.0 && <7.0.0 or Agent's versions >=7.25.0.
113
115
 
116
+ #### Skipping the tag sort
117
+
118
+ By default, the aggregator sorts the tags of every metric it receives. The sort makes two calls with the same tags
119
+ in a different order aggregate into one sample:
120
+
121
+ ```ruby
122
+ StatsD.increment("my.counter", tags: ["a:1", "b:2"])
123
+ StatsD.increment("my.counter", tags: ["b:2", "a:1"])
124
+ # my.counter:2|c|#a:1,b:2
125
+ ```
126
+
127
+ The sort runs on every metric call. If your StatsD server combines metrics that have the same tags in a different
128
+ order, as the Datadog Agent does, the server already does this work and you can skip the sort in the client. Set
129
+ `STATSD_AGGREGATION_SORT_TAGS=false`, or pass `aggregation_sort_tags: false` when you create a client yourself:
130
+
131
+ ```ruby
132
+ StatsD::Instrument::Client.new(sink: sink, enable_aggregation: true, aggregation_sort_tags: false)
133
+ ```
134
+
135
+ Without the sort:
136
+
137
+ - The library sends tags in the order you provide them. For hash tags, this is the insertion order of the hash.
138
+ - Calls with the same tags in a different order aggregate separately, and the library sends one sample for each order:
139
+ ```
140
+ my.counter:1|c|#a:1,b:2
141
+ my.counter:1|c|#b:2,a:1
142
+ ```
143
+ The server adds these together, so counter, histogram, distribution and timing results do not change. The library
144
+ sends more data when your code emits the same tags in many different orders.
145
+ - A gauge that receives the same tags in more than one order during one flush interval sends one sample for each order.
146
+ The server keeps the last sample it receives, which is not always the value you set last. Use one tag order for each
147
+ gauge to avoid this.
148
+ - The aggregator does not change the tag array you pass. With the sort, the aggregator sorts that array in place.
149
+
150
+ Do not skip the sort if your StatsD server treats the same tags in a different order as different metrics.
151
+
114
152
  ## StatsD keys
115
153
 
116
154
  StatsD keys look like 'admin.logins.api.success'. Dots are used as namespace separators.
@@ -98,13 +98,16 @@ module StatsD
98
98
  # @param default_tags [Array<String>] The tags to add to all metrics.
99
99
  # @param flush_interval [Float] The interval at which to flush the aggregated metrics.
100
100
  # @param max_values [Integer] The maximum number of values to aggregate before flushing.
101
+ # @param sort_tags [Boolean] Whether to sort tags before aggregating. When false, the same tags
102
+ # in a different order aggregate separately, and the StatsD server has to combine them.
101
103
  def initialize(
102
104
  sink,
103
105
  datagram_builder_class,
104
106
  prefix,
105
107
  default_tags,
106
108
  flush_interval: 5.0,
107
- max_values: DEFAULT_MAX_CONTEXT_SIZE
109
+ max_values: DEFAULT_MAX_CONTEXT_SIZE,
110
+ sort_tags: true
108
111
  )
109
112
  @sink = sink
110
113
  @datagram_builder_class = datagram_builder_class
@@ -115,6 +118,7 @@ module StatsD
115
118
  false: nil,
116
119
  }
117
120
  @max_values = max_values
121
+ @sort_tags = sort_tags
118
122
 
119
123
  # Mutex protects the aggregation_state and flush_thread from concurrent access
120
124
  @aggregation_state_mutex = Mutex.new
@@ -154,7 +158,7 @@ module StatsD
154
158
  return
155
159
  end
156
160
 
157
- tags = tags_sorted(tags)
161
+ tags = @sort_tags ? tags_sorted(tags) : tags_unsorted(tags)
158
162
  key = packet_key(name, tags, no_prefix, COUNT, sample_rate: sample_rate)
159
163
 
160
164
  @aggregation_state_mutex.synchronize do
@@ -232,7 +236,7 @@ module StatsD
232
236
  return
233
237
  end
234
238
 
235
- tags = tags_sorted(tags)
239
+ tags = @sort_tags ? tags_sorted(tags) : tags_unsorted(tags)
236
240
  key = packet_key(name, tags, no_prefix, type, sample_rate: sample_rate)
237
241
 
238
242
  aggregation_state = nil
@@ -255,7 +259,7 @@ module StatsD
255
259
  return
256
260
  end
257
261
 
258
- tags = tags_sorted(tags)
262
+ tags = @sort_tags ? tags_sorted(tags) : tags_unsorted(tags)
259
263
  key = packet_key(name, tags, no_prefix, GAUGE)
260
264
 
261
265
  @aggregation_state_mutex.synchronize do
@@ -334,6 +338,12 @@ module StatsD
334
338
  datagram_builder(no_prefix: false).normalize_tags(tags)
335
339
  end
336
340
 
341
+ def tags_unsorted(tags)
342
+ return "" if tags.nil? || tags.empty?
343
+
344
+ datagram_builder(no_prefix: false).normalize_tags(tags)
345
+ end
346
+
337
347
  def packet_key(name, tags = "".b, no_prefix = false, type = COUNT, sample_rate: CONST_SAMPLE_RATE)
338
348
  AggregationKey.new(
339
349
  DatagramBuilder.normalize_string(name),
@@ -46,6 +46,7 @@ module StatsD
46
46
  datagram_builder_class: datagram_builder_class,
47
47
  enable_aggregation: env.experimental_aggregation_enabled?,
48
48
  aggregation_flush_interval: env.aggregation_interval,
49
+ aggregation_sort_tags: env.aggregation_sort_tags?,
49
50
  aggregator: aggregator,
50
51
  )
51
52
  end
@@ -160,6 +161,10 @@ module StatsD
160
161
  # +flush+. Calls without tags receive a shared frozen empty array. Other tag
161
162
  # values are forwarded as-is; custom backends may require arrays.
162
163
  #
164
+ # @param aggregation_sort_tags [Boolean] Whether the built-in aggregator sorts
165
+ # tags before aggregating. Set to false to skip the sort when the StatsD server
166
+ # combines metrics that have the same tags in a different order. Ignored when
167
+ # an external aggregator is injected; the backend decides how to handle tags.
163
168
  # @param aggregator [#increment, #gauge, #aggregate_timing, nil]
164
169
  # Optional external aggregation backend.
165
170
  # @see .from_env to instantiate a client using environment variables.
@@ -173,6 +178,7 @@ module StatsD
173
178
  enable_aggregation: false,
174
179
  aggregation_flush_interval: 2.0,
175
180
  aggregation_max_context_size: StatsD::Instrument::Aggregator::DEFAULT_MAX_CONTEXT_SIZE,
181
+ aggregation_sort_tags: true,
176
182
  aggregator: nil
177
183
  )
178
184
  @sink = sink
@@ -186,6 +192,7 @@ module StatsD
186
192
  @injected_aggregator = aggregator
187
193
  @enable_aggregation = enable_aggregation || !aggregator.nil?
188
194
  @aggregation_flush_interval = aggregation_flush_interval
195
+ @aggregation_sort_tags = aggregation_sort_tags
189
196
  if @enable_aggregation
190
197
  @aggregator = aggregator ||
191
198
  Aggregator.new(
@@ -195,6 +202,7 @@ module StatsD
195
202
  default_tags,
196
203
  flush_interval: @aggregation_flush_interval,
197
204
  max_values: aggregation_max_context_size,
205
+ sort_tags: @aggregation_sort_tags,
198
206
  )
199
207
  end
200
208
  end
@@ -640,6 +648,7 @@ module StatsD
640
648
  datagram_builder_class == NO_CHANGE ? @datagram_builder_class : datagram_builder_class,
641
649
  enable_aggregation: @enable_aggregation,
642
650
  aggregation_flush_interval: @aggregation_flush_interval,
651
+ aggregation_sort_tags: @aggregation_sort_tags,
643
652
  aggregator: aggregator == NO_CHANGE ? @injected_aggregator : aggregator,
644
653
  )
645
654
  end
@@ -6,6 +6,12 @@ module StatsD
6
6
  # to become the new default in the next major release of this library.
7
7
  class DatagramBuilder
8
8
  extend Forwardable
9
+
10
+ # Symbol#name returns the interned string of a symbol, and Symbol#to_s allocates a copy.
11
+ # Symbol#name arrived in Ruby 3.0, and this gem supports Ruby 2.6.
12
+ SYMBOL_HAS_NAME = Symbol.method_defined?(:name)
13
+ private_constant :SYMBOL_HAS_NAME
14
+
9
15
  class << self
10
16
  def unsupported_datagram_types(*types)
11
17
  types.each do |type|
@@ -117,9 +123,9 @@ module StatsD
117
123
  else
118
124
  buffer << ","
119
125
  end
120
- key = key.to_s
126
+ key = SYMBOL_HAS_NAME && key.is_a?(Symbol) ? key.name : key.to_s
121
127
  key = key.tr(Sanitization::TAG_CHARACTERS, "") if Sanitization::TAG_PATTERN.match?(key)
122
- value = value.to_s
128
+ value = SYMBOL_HAS_NAME && value.is_a?(Symbol) ? value.name : value.to_s
123
129
  value = value.tr(Sanitization::TAG_CHARACTERS, "") if Sanitization::TAG_PATTERN.match?(value)
124
130
  buffer << key << ":" << value
125
131
  end
@@ -132,6 +132,10 @@ module StatsD
132
132
  ))
133
133
  end
134
134
 
135
+ def aggregation_sort_tags?
136
+ !["false", "0"].include?(env.fetch("STATSD_AGGREGATION_SORT_TAGS", "true").downcase)
137
+ end
138
+
135
139
  def client
136
140
  StatsD::Instrument::Client.from_env(self)
137
141
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module StatsD
4
4
  module Instrument
5
- VERSION = "4.0.1"
5
+ VERSION = "4.1.0"
6
6
  end
7
7
  end
@@ -146,6 +146,83 @@ class AggregatorTest < Minitest::Test
146
146
  assert_equal(2, @sink.datagrams.first.value)
147
147
  end
148
148
 
149
+ def test_unsorted_tags_in_different_orders_aggregate_separately
150
+ aggregator = unsorted_aggregator
151
+ aggregator.increment("foo", 1, ["tag1:val1", "tag2:val2"], false, 1.0)
152
+ aggregator.increment("foo", 1, ["tag1:val1", "tag2:val2"], false, 1.0)
153
+ aggregator.increment("foo", 1, ["tag2:val2", "tag1:val1"], false, 1.0)
154
+ aggregator.flush
155
+
156
+ assert_equal(
157
+ ["foo:2|c|#tag1:val1,tag2:val2", "foo:1|c|#tag2:val2,tag1:val1"],
158
+ @sink.datagrams.map(&:source),
159
+ )
160
+ ensure
161
+ aggregator&.instance_variable_get(:@flush_thread)&.kill
162
+ end
163
+
164
+ def test_unsorted_tags_keep_hash_order
165
+ aggregator = unsorted_aggregator
166
+ aggregator.aggregate_timing("foo", 1, { tag2: "val2", tag1: "val1" }, false, :d, 1.0)
167
+ aggregator.aggregate_timing("foo", 2, ["tag2:val2", "tag1:val1"], false, :d, 1.0)
168
+ aggregator.gauge("bar", 3, { tag2: "val2", tag1: "val1" }, false)
169
+ aggregator.flush
170
+
171
+ assert_equal(
172
+ ["foo:1:2|d|#tag2:val2,tag1:val1", "bar:3|g|#tag2:val2,tag1:val1"],
173
+ @sink.datagrams.map(&:source),
174
+ )
175
+ ensure
176
+ aggregator&.instance_variable_get(:@flush_thread)&.kill
177
+ end
178
+
179
+ def test_unsorted_hash_tags_are_normalized_like_sorted_hash_tags
180
+ tags = { "tool|name": "a,b", pid: 42, kind: :read, "line\nbreak" => true }
181
+ aggregator = unsorted_aggregator
182
+ aggregator.increment("foo", 1, tags, false, 1.0)
183
+ aggregator.flush
184
+ @subject.increment("foo", 1, tags, false, 1.0)
185
+ @subject.flush
186
+
187
+ assert_equal(
188
+ ["foo:1|c|#toolname:ab,pid:42,kind:read,linebreak:true", "foo:1|c|#kind:read,linebreak:true,pid:42,toolname:ab"],
189
+ @sink.datagrams.map(&:source),
190
+ )
191
+ ensure
192
+ aggregator&.instance_variable_get(:@flush_thread)&.kill
193
+ end
194
+
195
+ def test_unsorted_tags_accept_a_serialized_string
196
+ aggregator = unsorted_aggregator
197
+ aggregator.increment("foo", 1, ["tag2:val2", "tag1:val1"], false, 1.0)
198
+ aggregator.increment("foo", 1, "tag2:val2,tag1:val1", false, 1.0)
199
+ aggregator.flush
200
+
201
+ assert_equal(["foo:2|c|#tag2:val2,tag1:val1"], @sink.datagrams.map(&:source))
202
+ ensure
203
+ aggregator&.instance_variable_get(:@flush_thread)&.kill
204
+ end
205
+
206
+ def test_unsorted_tags_do_not_mutate_the_caller_tags
207
+ aggregator = unsorted_aggregator
208
+ tags = ["tag2:val2", "tag1:val1"].freeze
209
+ aggregator.increment("foo", 1, tags, false, 1.0)
210
+ aggregator.flush
211
+
212
+ assert_equal(["tag2:val2", "tag1:val1"], tags)
213
+ assert_equal("foo:1|c|#tag2:val2,tag1:val1", @sink.datagrams.first.source)
214
+ ensure
215
+ aggregator&.instance_variable_get(:@flush_thread)&.kill
216
+ end
217
+
218
+ def test_hash_tags_raise_at_the_call_site_without_tag_support_when_sorting
219
+ assert_hash_tags_raise_at_the_call_site(sort_tags: true)
220
+ end
221
+
222
+ def test_hash_tags_raise_at_the_call_site_without_tag_support_when_not_sorting
223
+ assert_hash_tags_raise_at_the_call_site(sort_tags: false)
224
+ end
225
+
149
226
  def test_increment_with_different_tag_values
150
227
  @subject.increment("foo", 1, ["tag1:val1", "tag2:val2"], false, 1.0)
151
228
  @subject.increment("foo", 1, { tag1: "val1", tag2: "val2" }, false, 1.0)
@@ -473,4 +550,25 @@ class AggregatorTest < Minitest::Test
473
550
  ensure
474
551
  Signal.trap("USR1", old_trap || "DEFAULT")
475
552
  end
553
+
554
+ private
555
+
556
+ def unsorted_aggregator
557
+ StatsD::Instrument::Aggregator.new(@sink, StatsD::Instrument::DatagramBuilder, nil, [], sort_tags: false)
558
+ end
559
+
560
+ def assert_hash_tags_raise_at_the_call_site(sort_tags:)
561
+ aggregator = StatsD::Instrument::Aggregator.new(
562
+ @sink, StatsD::Instrument::StatsDDatagramBuilder, nil, [], sort_tags: sort_tags
563
+ )
564
+ tags = { tag2: "val2", tag1: "val1" }
565
+
566
+ assert_raises(NotImplementedError) { aggregator.increment("foo", 1, tags, false, 1.0) }
567
+ assert_raises(NotImplementedError) { aggregator.aggregate_timing("foo", 1, tags, false, :ms, 1.0) }
568
+ assert_raises(NotImplementedError) { aggregator.gauge("bar", 1, tags, false) }
569
+ aggregator.flush
570
+ assert_empty(@sink.datagrams)
571
+ ensure
572
+ aggregator&.instance_variable_get(:@flush_thread)&.kill
573
+ end
476
574
  end
data/test/client_test.rb CHANGED
@@ -166,6 +166,37 @@ class ClientTest < Minitest::Test
166
166
  clone&.instance_variable_get(:@aggregator)&.instance_variable_get(:@flush_thread)&.kill
167
167
  end
168
168
 
169
+ def test_client_from_env_without_aggregation_tag_sorting
170
+ env = StatsD::Instrument::Environment.new(
171
+ "STATSD_ENABLE_AGGREGATION" => "true",
172
+ "STATSD_AGGREGATION_SORT_TAGS" => "false",
173
+ )
174
+ client = StatsD::Instrument::Client.from_env(
175
+ env,
176
+ sink: StatsD::Instrument::CaptureSink.new(parent: StatsD::Instrument::NullSink.new),
177
+ )
178
+ clone = client.clone_with_options(prefix: "clone")
179
+
180
+ [client, clone].each do |c|
181
+ c.increment("requests", tags: ["b:2", "a:1"])
182
+ c.increment("requests", tags: ["a:1", "b:2"])
183
+ c.force_flush
184
+ end
185
+
186
+ assert_equal(
187
+ [
188
+ "requests:1|c|#b:2,a:1",
189
+ "requests:1|c|#a:1,b:2",
190
+ "clone.requests:1|c|#b:2,a:1",
191
+ "clone.requests:1|c|#a:1,b:2",
192
+ ],
193
+ client.sink.datagrams.map(&:source),
194
+ )
195
+ ensure
196
+ client&.instance_variable_get(:@aggregator)&.instance_variable_get(:@flush_thread)&.kill
197
+ clone&.instance_variable_get(:@aggregator)&.instance_variable_get(:@flush_thread)&.kill
198
+ end
199
+
169
200
  def test_capture
170
201
  inner_datagrams = nil
171
202
 
@@ -27,6 +27,22 @@ class DatagramBuilderTest < Minitest::Test
27
27
  assert_equal("tag1:v1,tag2:v2", @datagram_builder.send(:compile_tags, { tag1: "v1", tag2: "v2" }))
28
28
  end
29
29
 
30
+ def test_compile_tags_with_symbol_and_other_hash_keys_and_values
31
+ assert_equal(
32
+ "kind:read,pid:42,mobile:true,path:/cart,1:2",
33
+ @datagram_builder.send(:compile_tags, { kind: :read, pid: 42, mobile: true, "path" => "/cart", 1 => 2 }),
34
+ )
35
+ end
36
+
37
+ def test_compile_tags_sanitizes_symbol_hash_keys_and_values_without_changing_the_symbols
38
+ key = :"tool|name"
39
+ value = :"a,b"
40
+
41
+ assert_equal("toolname:ab", @datagram_builder.send(:compile_tags, { key => value }))
42
+ assert_equal("tool|name", key.to_s)
43
+ assert_equal("a,b", value.to_s)
44
+ end
45
+
30
46
  def test_c
31
47
  datagram = @datagram_builder.c("foo", 1, nil, nil)
32
48
  assert_equal("foo:1|c", datagram)
@@ -31,6 +31,19 @@ class EnvironmentTest < Minitest::Test
31
31
  assert_equal("development", env.environment)
32
32
  end
33
33
 
34
+ def test_aggregation_sorts_tags_unless_disabled
35
+ assert_predicate(StatsD::Instrument::Environment.new({}), :aggregation_sort_tags?)
36
+ assert_predicate(
37
+ StatsD::Instrument::Environment.new("STATSD_AGGREGATION_SORT_TAGS" => "true"),
38
+ :aggregation_sort_tags?,
39
+ )
40
+
41
+ ["false", "FALSE", "0"].each do |value|
42
+ env = StatsD::Instrument::Environment.new("STATSD_AGGREGATION_SORT_TAGS" => value)
43
+ refute_predicate(env, :aggregation_sort_tags?)
44
+ end
45
+ end
46
+
34
47
  def test_client_returns_client_instance
35
48
  env = StatsD::Instrument::Environment.new({})
36
49
  assert_kind_of(StatsD::Instrument::Client, env.client)
metadata CHANGED
@@ -1,183 +1,184 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: statsd-instrument
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.1
4
+ version: 4.1.0
5
5
  platform: ruby
6
6
  authors:
7
- - Jesse Storimer
8
- - Tobias Lutke
9
- - Willem van Bergen
7
+ - Jesse Storimer
8
+ - Tobias Lutke
9
+ - Willem van Bergen
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
  date: 1980-01-02 00:00:00.000000000 Z
13
13
  dependencies: []
14
- description: A StatsD client for Ruby apps. Provides metaprogramming methods to inject
15
- StatsD instrumentation into your code.
14
+ description: A StatsD client for Ruby apps. Provides metaprogramming methods to inject StatsD instrumentation into your code.
16
15
  email:
17
- - jesse@shopify.com
16
+ - jesse@shopify.com
18
17
  executables: []
19
18
  extensions: []
20
19
  extra_rdoc_files: []
21
20
  files:
22
- - ".github/CODEOWNERS"
23
- - ".github/pull_request_template.md"
24
- - ".github/workflows/benchmark.yml"
25
- - ".github/workflows/cla.yml"
26
- - ".github/workflows/lint.yml"
27
- - ".github/workflows/tests.yml"
28
- - ".gitignore"
29
- - ".rubocop.yml"
30
- - ".ruby-version"
31
- - ".yardopts"
32
- - CHANGELOG.md
33
- - CONTRIBUTING.md
34
- - Gemfile
35
- - LICENSE
36
- - Makefile
37
- - README.md
38
- - Rakefile
39
- - benchmark/README.md
40
- - benchmark/local-udp-throughput
41
- - benchmark/send-metrics-to-dev-null-log
42
- - benchmark/send-metrics-to-local-udp-receiver
43
- - bin/rake
44
- - bin/rubocop
45
- - lib/statsd-instrument.rb
46
- - lib/statsd/instrument.rb
47
- - lib/statsd/instrument/aggregator.rb
48
- - lib/statsd/instrument/assertions.rb
49
- - lib/statsd/instrument/batched_sink.rb
50
- - lib/statsd/instrument/capture_sink.rb
51
- - lib/statsd/instrument/client.rb
52
- - lib/statsd/instrument/compiled_metric.rb
53
- - lib/statsd/instrument/connection_behavior.rb
54
- - lib/statsd/instrument/datagram.rb
55
- - lib/statsd/instrument/datagram_builder.rb
56
- - lib/statsd/instrument/dogstatsd_datagram.rb
57
- - lib/statsd/instrument/dogstatsd_datagram_builder.rb
58
- - lib/statsd/instrument/environment.rb
59
- - lib/statsd/instrument/expectation.rb
60
- - lib/statsd/instrument/helpers.rb
61
- - lib/statsd/instrument/log_sink.rb
62
- - lib/statsd/instrument/matchers.rb
63
- - lib/statsd/instrument/null_sink.rb
64
- - lib/statsd/instrument/railtie.rb
65
- - lib/statsd/instrument/rubocop.rb
66
- - lib/statsd/instrument/rubocop/measure_as_dist_argument.rb
67
- - lib/statsd/instrument/rubocop/metaprogramming_positional_arguments.rb
68
- - lib/statsd/instrument/rubocop/metric_prefix_argument.rb
69
- - lib/statsd/instrument/rubocop/metric_return_value.rb
70
- - lib/statsd/instrument/rubocop/metric_value_keyword_argument.rb
71
- - lib/statsd/instrument/rubocop/positional_arguments.rb
72
- - lib/statsd/instrument/rubocop/singleton_configuration.rb
73
- - lib/statsd/instrument/rubocop/splat_arguments.rb
74
- - lib/statsd/instrument/sanitization.rb
75
- - lib/statsd/instrument/sink.rb
76
- - lib/statsd/instrument/statsd_datagram_builder.rb
77
- - lib/statsd/instrument/strict.rb
78
- - lib/statsd/instrument/udp_connection.rb
79
- - lib/statsd/instrument/uds_connection.rb
80
- - lib/statsd/instrument/version.rb
81
- - shipit.rubygems.yml
82
- - statsd-instrument.gemspec
83
- - test/aggregator_test.rb
84
- - test/assertions_test.rb
85
- - test/benchmark/clock_gettime.rb
86
- - test/benchmark/metrics.rb
87
- - test/benchmark/tags.rb
88
- - test/capture_sink_test.rb
89
- - test/changelog_test.rb
90
- - test/client_test.rb
91
- - test/compiled_metric/counter_test.rb
92
- - test/compiled_metric/distribution_test.rb
93
- - test/compiled_metric/gauge_test.rb
94
- - test/compiled_metric_test.rb
95
- - test/datagram_builder_test.rb
96
- - test/datagram_test.rb
97
- - test/dispatcher_stats_test.rb
98
- - test/dogstatsd_datagram_builder_test.rb
99
- - test/environment_test.rb
100
- - test/helpers/rubocop_helper.rb
101
- - test/helpers_test.rb
102
- - test/integration_test.rb
103
- - test/log_sink_test.rb
104
- - test/matchers_test.rb
105
- - test/newline_normalization_test.rb
106
- - test/null_sink_test.rb
107
- - test/rubocop/measure_as_dist_argument_test.rb
108
- - test/rubocop/metaprogramming_positional_arguments_test.rb
109
- - test/rubocop/metric_prefix_argument_test.rb
110
- - test/rubocop/metric_return_value_test.rb
111
- - test/rubocop/metric_value_keyword_argument_test.rb
112
- - test/rubocop/positional_arguments_test.rb
113
- - test/rubocop/singleton_configuration_test.rb
114
- - test/rubocop/splat_arguments_test.rb
115
- - test/sanitization_test.rb
116
- - test/statsd_datagram_builder_test.rb
117
- - test/statsd_instrumentation_test.rb
118
- - test/statsd_test.rb
119
- - test/test_helper.rb
120
- - test/udp_sink_test.rb
121
- - test/uds_sink_test.rb
122
- homepage: https://github.com/Shopify/statsd-instrument
21
+ - .github/CODEOWNERS
22
+ - .github/pull_request_template.md
23
+ - .github/workflows/benchmark.yml
24
+ - .github/workflows/cla.yml
25
+ - .github/workflows/lint.yml
26
+ - .github/workflows/tests.yml
27
+ - .gitignore
28
+ - .rubocop.yml
29
+ - .ruby-version
30
+ - .yardopts
31
+ - CHANGELOG.md
32
+ - CONTRIBUTING.md
33
+ - Gemfile
34
+ - LICENSE
35
+ - Makefile
36
+ - README.md
37
+ - Rakefile
38
+ - benchmark/README.md
39
+ - benchmark/local-udp-throughput
40
+ - benchmark/send-metrics-to-dev-null-log
41
+ - benchmark/send-metrics-to-local-udp-receiver
42
+ - bin/rake
43
+ - bin/rubocop
44
+ - lib/statsd-instrument.rb
45
+ - lib/statsd/instrument.rb
46
+ - lib/statsd/instrument/aggregator.rb
47
+ - lib/statsd/instrument/assertions.rb
48
+ - lib/statsd/instrument/batched_sink.rb
49
+ - lib/statsd/instrument/capture_sink.rb
50
+ - lib/statsd/instrument/client.rb
51
+ - lib/statsd/instrument/compiled_metric.rb
52
+ - lib/statsd/instrument/connection_behavior.rb
53
+ - lib/statsd/instrument/datagram.rb
54
+ - lib/statsd/instrument/datagram_builder.rb
55
+ - lib/statsd/instrument/dogstatsd_datagram.rb
56
+ - lib/statsd/instrument/dogstatsd_datagram_builder.rb
57
+ - lib/statsd/instrument/environment.rb
58
+ - lib/statsd/instrument/expectation.rb
59
+ - lib/statsd/instrument/helpers.rb
60
+ - lib/statsd/instrument/log_sink.rb
61
+ - lib/statsd/instrument/matchers.rb
62
+ - lib/statsd/instrument/null_sink.rb
63
+ - lib/statsd/instrument/railtie.rb
64
+ - lib/statsd/instrument/rubocop.rb
65
+ - lib/statsd/instrument/rubocop/measure_as_dist_argument.rb
66
+ - lib/statsd/instrument/rubocop/metaprogramming_positional_arguments.rb
67
+ - lib/statsd/instrument/rubocop/metric_prefix_argument.rb
68
+ - lib/statsd/instrument/rubocop/metric_return_value.rb
69
+ - lib/statsd/instrument/rubocop/metric_value_keyword_argument.rb
70
+ - lib/statsd/instrument/rubocop/positional_arguments.rb
71
+ - lib/statsd/instrument/rubocop/singleton_configuration.rb
72
+ - lib/statsd/instrument/rubocop/splat_arguments.rb
73
+ - lib/statsd/instrument/sanitization.rb
74
+ - lib/statsd/instrument/sink.rb
75
+ - lib/statsd/instrument/statsd_datagram_builder.rb
76
+ - lib/statsd/instrument/strict.rb
77
+ - lib/statsd/instrument/udp_connection.rb
78
+ - lib/statsd/instrument/uds_connection.rb
79
+ - lib/statsd/instrument/version.rb
80
+ - shipit.rubygems.yml
81
+ - statsd-instrument.gemspec
82
+ - test/aggregator_test.rb
83
+ - test/assertions_test.rb
84
+ - test/benchmark/clock_gettime.rb
85
+ - test/benchmark/metrics.rb
86
+ - test/benchmark/tags.rb
87
+ - test/capture_sink_test.rb
88
+ - test/changelog_test.rb
89
+ - test/client_test.rb
90
+ - test/compiled_metric/counter_test.rb
91
+ - test/compiled_metric/distribution_test.rb
92
+ - test/compiled_metric/gauge_test.rb
93
+ - test/compiled_metric_test.rb
94
+ - test/datagram_builder_test.rb
95
+ - test/datagram_test.rb
96
+ - test/dispatcher_stats_test.rb
97
+ - test/dogstatsd_datagram_builder_test.rb
98
+ - test/environment_test.rb
99
+ - test/helpers/rubocop_helper.rb
100
+ - test/helpers_test.rb
101
+ - test/integration_test.rb
102
+ - test/log_sink_test.rb
103
+ - test/matchers_test.rb
104
+ - test/newline_normalization_test.rb
105
+ - test/null_sink_test.rb
106
+ - test/rubocop/measure_as_dist_argument_test.rb
107
+ - test/rubocop/metaprogramming_positional_arguments_test.rb
108
+ - test/rubocop/metric_prefix_argument_test.rb
109
+ - test/rubocop/metric_return_value_test.rb
110
+ - test/rubocop/metric_value_keyword_argument_test.rb
111
+ - test/rubocop/positional_arguments_test.rb
112
+ - test/rubocop/singleton_configuration_test.rb
113
+ - test/rubocop/splat_arguments_test.rb
114
+ - test/sanitization_test.rb
115
+ - test/statsd_datagram_builder_test.rb
116
+ - test/statsd_instrumentation_test.rb
117
+ - test/statsd_test.rb
118
+ - test/test_helper.rb
119
+ - test/udp_sink_test.rb
120
+ - test/uds_sink_test.rb
121
+ homepage: "https://github.com/Shopify/statsd-instrument"
123
122
  licenses:
124
- - MIT
123
+ - MIT
125
124
  metadata:
126
- allowed_push_host: https://rubygems.org
125
+ allowed_push_host: "https://rubygems.org"
127
126
  rdoc_options: []
128
127
  require_paths:
129
- - lib
128
+ - lib
130
129
  required_ruby_version: !ruby/object:Gem::Requirement
131
130
  requirements:
132
- - - ">="
133
- - !ruby/object:Gem::Version
134
- version: 2.6.0
131
+ -
132
+ - ">="
133
+ - !ruby/object:Gem::Version
134
+ version: 2.6.0
135
135
  required_rubygems_version: !ruby/object:Gem::Requirement
136
136
  requirements:
137
- - - ">="
138
- - !ruby/object:Gem::Version
139
- version: '0'
137
+ -
138
+ - ">="
139
+ - !ruby/object:Gem::Version
140
+ version: "0"
140
141
  requirements: []
141
- rubygems_version: 4.0.21
142
+ rubygems_version: 4.1.0
142
143
  specification_version: 4
143
144
  summary: A StatsD client for Ruby apps
144
145
  test_files:
145
- - test/aggregator_test.rb
146
- - test/assertions_test.rb
147
- - test/benchmark/clock_gettime.rb
148
- - test/benchmark/metrics.rb
149
- - test/benchmark/tags.rb
150
- - test/capture_sink_test.rb
151
- - test/changelog_test.rb
152
- - test/client_test.rb
153
- - test/compiled_metric/counter_test.rb
154
- - test/compiled_metric/distribution_test.rb
155
- - test/compiled_metric/gauge_test.rb
156
- - test/compiled_metric_test.rb
157
- - test/datagram_builder_test.rb
158
- - test/datagram_test.rb
159
- - test/dispatcher_stats_test.rb
160
- - test/dogstatsd_datagram_builder_test.rb
161
- - test/environment_test.rb
162
- - test/helpers/rubocop_helper.rb
163
- - test/helpers_test.rb
164
- - test/integration_test.rb
165
- - test/log_sink_test.rb
166
- - test/matchers_test.rb
167
- - test/newline_normalization_test.rb
168
- - test/null_sink_test.rb
169
- - test/rubocop/measure_as_dist_argument_test.rb
170
- - test/rubocop/metaprogramming_positional_arguments_test.rb
171
- - test/rubocop/metric_prefix_argument_test.rb
172
- - test/rubocop/metric_return_value_test.rb
173
- - test/rubocop/metric_value_keyword_argument_test.rb
174
- - test/rubocop/positional_arguments_test.rb
175
- - test/rubocop/singleton_configuration_test.rb
176
- - test/rubocop/splat_arguments_test.rb
177
- - test/sanitization_test.rb
178
- - test/statsd_datagram_builder_test.rb
179
- - test/statsd_instrumentation_test.rb
180
- - test/statsd_test.rb
181
- - test/test_helper.rb
182
- - test/udp_sink_test.rb
183
- - test/uds_sink_test.rb
146
+ - test/aggregator_test.rb
147
+ - test/assertions_test.rb
148
+ - test/benchmark/clock_gettime.rb
149
+ - test/benchmark/metrics.rb
150
+ - test/benchmark/tags.rb
151
+ - test/capture_sink_test.rb
152
+ - test/changelog_test.rb
153
+ - test/client_test.rb
154
+ - test/compiled_metric/counter_test.rb
155
+ - test/compiled_metric/distribution_test.rb
156
+ - test/compiled_metric/gauge_test.rb
157
+ - test/compiled_metric_test.rb
158
+ - test/datagram_builder_test.rb
159
+ - test/datagram_test.rb
160
+ - test/dispatcher_stats_test.rb
161
+ - test/dogstatsd_datagram_builder_test.rb
162
+ - test/environment_test.rb
163
+ - test/helpers/rubocop_helper.rb
164
+ - test/helpers_test.rb
165
+ - test/integration_test.rb
166
+ - test/log_sink_test.rb
167
+ - test/matchers_test.rb
168
+ - test/newline_normalization_test.rb
169
+ - test/null_sink_test.rb
170
+ - test/rubocop/measure_as_dist_argument_test.rb
171
+ - test/rubocop/metaprogramming_positional_arguments_test.rb
172
+ - test/rubocop/metric_prefix_argument_test.rb
173
+ - test/rubocop/metric_return_value_test.rb
174
+ - test/rubocop/metric_value_keyword_argument_test.rb
175
+ - test/rubocop/positional_arguments_test.rb
176
+ - test/rubocop/singleton_configuration_test.rb
177
+ - test/rubocop/splat_arguments_test.rb
178
+ - test/sanitization_test.rb
179
+ - test/statsd_datagram_builder_test.rb
180
+ - test/statsd_instrumentation_test.rb
181
+ - test/statsd_test.rb
182
+ - test/test_helper.rb
183
+ - test/udp_sink_test.rb
184
+ - test/uds_sink_test.rb