statsd-instrument 2.3.2 → 2.6.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 +4 -4
 - data/.github/CODEOWNERS +1 -0
 - data/.github/workflows/benchmark.yml +32 -0
 - data/.github/workflows/ci.yml +47 -0
 - data/.gitignore +1 -0
 - data/.rubocop-https---shopify-github-io-ruby-style-guide-rubocop-yml +1027 -0
 - data/.rubocop.yml +50 -0
 - data/.yardopts +5 -0
 - data/CHANGELOG.md +288 -2
 - data/CONTRIBUTING.md +28 -6
 - data/Gemfile +5 -0
 - data/README.md +54 -46
 - data/Rakefile +4 -2
 - data/benchmark/README.md +29 -0
 - data/benchmark/datagram-client +41 -0
 - data/benchmark/send-metrics-to-dev-null-log +47 -0
 - data/benchmark/send-metrics-to-local-udp-receiver +57 -0
 - data/lib/statsd/instrument/assertions.rb +179 -30
 - data/lib/statsd/instrument/backend.rb +3 -2
 - data/lib/statsd/instrument/backends/capture_backend.rb +4 -1
 - data/lib/statsd/instrument/backends/logger_backend.rb +3 -3
 - data/lib/statsd/instrument/backends/null_backend.rb +2 -0
 - data/lib/statsd/instrument/backends/udp_backend.rb +39 -45
 - data/lib/statsd/instrument/capture_sink.rb +27 -0
 - data/lib/statsd/instrument/client.rb +313 -0
 - data/lib/statsd/instrument/datagram.rb +75 -0
 - data/lib/statsd/instrument/datagram_builder.rb +101 -0
 - data/lib/statsd/instrument/dogstatsd_datagram_builder.rb +71 -0
 - data/lib/statsd/instrument/environment.rb +108 -29
 - data/lib/statsd/instrument/helpers.rb +16 -8
 - data/lib/statsd/instrument/log_sink.rb +24 -0
 - data/lib/statsd/instrument/matchers.rb +14 -11
 - data/lib/statsd/instrument/metric.rb +72 -45
 - data/lib/statsd/instrument/metric_expectation.rb +32 -18
 - data/lib/statsd/instrument/null_sink.rb +13 -0
 - data/lib/statsd/instrument/railtie.rb +2 -1
 - data/lib/statsd/instrument/rubocop/measure_as_dist_argument.rb +39 -0
 - data/lib/statsd/instrument/rubocop/metaprogramming_positional_arguments.rb +42 -0
 - data/lib/statsd/instrument/rubocop/metric_prefix_argument.rb +37 -0
 - data/lib/statsd/instrument/rubocop/metric_return_value.rb +32 -0
 - data/lib/statsd/instrument/rubocop/metric_value_keyword_argument.rb +36 -0
 - data/lib/statsd/instrument/rubocop/positional_arguments.rb +99 -0
 - data/lib/statsd/instrument/rubocop/splat_arguments.rb +31 -0
 - data/lib/statsd/instrument/rubocop.rb +64 -0
 - data/lib/statsd/instrument/statsd_datagram_builder.rb +14 -0
 - data/lib/statsd/instrument/strict.rb +235 -0
 - data/lib/statsd/instrument/udp_sink.rb +62 -0
 - data/lib/statsd/instrument/version.rb +3 -1
 - data/lib/statsd/instrument.rb +340 -163
 - data/lib/statsd-instrument.rb +2 -0
 - data/statsd-instrument.gemspec +13 -10
 - data/test/assertions_test.rb +167 -156
 - data/test/benchmark/clock_gettime.rb +27 -0
 - data/test/benchmark/default_tags.rb +47 -0
 - data/test/benchmark/metrics.rb +9 -8
 - data/test/benchmark/tags.rb +5 -3
 - data/test/capture_backend_test.rb +4 -2
 - data/test/capture_sink_test.rb +44 -0
 - data/test/client_test.rb +164 -0
 - data/test/compatibility/dogstatsd_datagram_compatibility_test.rb +162 -0
 - data/test/datagram_builder_test.rb +120 -0
 - data/test/deprecations_test.rb +132 -0
 - data/test/dogstatsd_datagram_builder_test.rb +32 -0
 - data/test/environment_test.rb +75 -8
 - data/test/helpers/rubocop_helper.rb +47 -0
 - data/test/helpers_test.rb +2 -1
 - data/test/integration_test.rb +31 -7
 - data/test/log_sink_test.rb +37 -0
 - data/test/logger_backend_test.rb +10 -8
 - data/test/matchers_test.rb +42 -28
 - data/test/metric_test.rb +18 -22
 - data/test/null_sink_test.rb +13 -0
 - data/test/rubocop/measure_as_dist_argument_test.rb +44 -0
 - data/test/rubocop/metaprogramming_positional_arguments_test.rb +58 -0
 - data/test/rubocop/metric_prefix_argument_test.rb +38 -0
 - data/test/rubocop/metric_return_value_test.rb +78 -0
 - data/test/rubocop/metric_value_keyword_argument_test.rb +39 -0
 - data/test/rubocop/positional_arguments_test.rb +110 -0
 - data/test/rubocop/splat_arguments_test.rb +27 -0
 - data/test/statsd_datagram_builder_test.rb +22 -0
 - data/test/statsd_instrumentation_test.rb +109 -100
 - data/test/statsd_test.rb +113 -79
 - data/test/test_helper.rb +12 -1
 - data/test/udp_backend_test.rb +38 -36
 - data/test/udp_sink_test.rb +85 -0
 - metadata +85 -5
 - data/.travis.yml +0 -12
 
    
        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. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 2.6.0
         
     | 
| 
       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:  
     | 
| 
      
 13 
     | 
    
         
            +
            date: 2019-10-03 00:00:00.000000000 Z
         
     | 
| 
       14 
14 
     | 
    
         
             
            dependencies:
         
     | 
| 
       15 
15 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       16 
16 
     | 
    
         
             
              name: rake
         
     | 
| 
         @@ -82,6 +82,20 @@ dependencies: 
     | 
|
| 
       82 
82 
     | 
    
         
             
                - - ">="
         
     | 
| 
       83 
83 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       84 
84 
     | 
    
         
             
                    version: '0'
         
     | 
| 
      
 85 
     | 
    
         
            +
            - !ruby/object:Gem::Dependency
         
     | 
| 
      
 86 
     | 
    
         
            +
              name: rubocop
         
     | 
| 
      
 87 
     | 
    
         
            +
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
      
 88 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 89 
     | 
    
         
            +
                - - ">="
         
     | 
| 
      
 90 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 91 
     | 
    
         
            +
                    version: '0'
         
     | 
| 
      
 92 
     | 
    
         
            +
              type: :development
         
     | 
| 
      
 93 
     | 
    
         
            +
              prerelease: false
         
     | 
| 
      
 94 
     | 
    
         
            +
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
      
 95 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 96 
     | 
    
         
            +
                - - ">="
         
     | 
| 
      
 97 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 98 
     | 
    
         
            +
                    version: '0'
         
     | 
| 
       85 
99 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       86 
100 
     | 
    
         
             
              name: benchmark-ips
         
     | 
| 
       87 
101 
     | 
    
         
             
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
         @@ -104,15 +118,24 @@ executables: [] 
     | 
|
| 
       104 
118 
     | 
    
         
             
            extensions: []
         
     | 
| 
       105 
119 
     | 
    
         
             
            extra_rdoc_files: []
         
     | 
| 
       106 
120 
     | 
    
         
             
            files:
         
     | 
| 
      
 121 
     | 
    
         
            +
            - ".github/CODEOWNERS"
         
     | 
| 
       107 
122 
     | 
    
         
             
            - ".github/probots.yml"
         
     | 
| 
      
 123 
     | 
    
         
            +
            - ".github/workflows/benchmark.yml"
         
     | 
| 
      
 124 
     | 
    
         
            +
            - ".github/workflows/ci.yml"
         
     | 
| 
       108 
125 
     | 
    
         
             
            - ".gitignore"
         
     | 
| 
       109 
     | 
    
         
            -
            - ". 
     | 
| 
      
 126 
     | 
    
         
            +
            - ".rubocop-https---shopify-github-io-ruby-style-guide-rubocop-yml"
         
     | 
| 
      
 127 
     | 
    
         
            +
            - ".rubocop.yml"
         
     | 
| 
      
 128 
     | 
    
         
            +
            - ".yardopts"
         
     | 
| 
       110 
129 
     | 
    
         
             
            - CHANGELOG.md
         
     | 
| 
       111 
130 
     | 
    
         
             
            - CONTRIBUTING.md
         
     | 
| 
       112 
131 
     | 
    
         
             
            - Gemfile
         
     | 
| 
       113 
132 
     | 
    
         
             
            - LICENSE
         
     | 
| 
       114 
133 
     | 
    
         
             
            - README.md
         
     | 
| 
       115 
134 
     | 
    
         
             
            - Rakefile
         
     | 
| 
      
 135 
     | 
    
         
            +
            - benchmark/README.md
         
     | 
| 
      
 136 
     | 
    
         
            +
            - benchmark/datagram-client
         
     | 
| 
      
 137 
     | 
    
         
            +
            - benchmark/send-metrics-to-dev-null-log
         
     | 
| 
      
 138 
     | 
    
         
            +
            - benchmark/send-metrics-to-local-udp-receiver
         
     | 
| 
       116 
139 
     | 
    
         
             
            - lib/statsd-instrument.rb
         
     | 
| 
       117 
140 
     | 
    
         
             
            - lib/statsd/instrument.rb
         
     | 
| 
       118 
141 
     | 
    
         
             
            - lib/statsd/instrument/assertions.rb
         
     | 
| 
         @@ -121,29 +144,67 @@ files: 
     | 
|
| 
       121 
144 
     | 
    
         
             
            - lib/statsd/instrument/backends/logger_backend.rb
         
     | 
| 
       122 
145 
     | 
    
         
             
            - lib/statsd/instrument/backends/null_backend.rb
         
     | 
| 
       123 
146 
     | 
    
         
             
            - lib/statsd/instrument/backends/udp_backend.rb
         
     | 
| 
      
 147 
     | 
    
         
            +
            - lib/statsd/instrument/capture_sink.rb
         
     | 
| 
      
 148 
     | 
    
         
            +
            - lib/statsd/instrument/client.rb
         
     | 
| 
      
 149 
     | 
    
         
            +
            - lib/statsd/instrument/datagram.rb
         
     | 
| 
      
 150 
     | 
    
         
            +
            - lib/statsd/instrument/datagram_builder.rb
         
     | 
| 
      
 151 
     | 
    
         
            +
            - lib/statsd/instrument/dogstatsd_datagram_builder.rb
         
     | 
| 
       124 
152 
     | 
    
         
             
            - lib/statsd/instrument/environment.rb
         
     | 
| 
       125 
153 
     | 
    
         
             
            - lib/statsd/instrument/helpers.rb
         
     | 
| 
      
 154 
     | 
    
         
            +
            - lib/statsd/instrument/log_sink.rb
         
     | 
| 
       126 
155 
     | 
    
         
             
            - lib/statsd/instrument/matchers.rb
         
     | 
| 
       127 
156 
     | 
    
         
             
            - lib/statsd/instrument/metric.rb
         
     | 
| 
       128 
157 
     | 
    
         
             
            - lib/statsd/instrument/metric_expectation.rb
         
     | 
| 
      
 158 
     | 
    
         
            +
            - lib/statsd/instrument/null_sink.rb
         
     | 
| 
       129 
159 
     | 
    
         
             
            - lib/statsd/instrument/railtie.rb
         
     | 
| 
      
 160 
     | 
    
         
            +
            - lib/statsd/instrument/rubocop.rb
         
     | 
| 
      
 161 
     | 
    
         
            +
            - lib/statsd/instrument/rubocop/measure_as_dist_argument.rb
         
     | 
| 
      
 162 
     | 
    
         
            +
            - lib/statsd/instrument/rubocop/metaprogramming_positional_arguments.rb
         
     | 
| 
      
 163 
     | 
    
         
            +
            - lib/statsd/instrument/rubocop/metric_prefix_argument.rb
         
     | 
| 
      
 164 
     | 
    
         
            +
            - lib/statsd/instrument/rubocop/metric_return_value.rb
         
     | 
| 
      
 165 
     | 
    
         
            +
            - lib/statsd/instrument/rubocop/metric_value_keyword_argument.rb
         
     | 
| 
      
 166 
     | 
    
         
            +
            - lib/statsd/instrument/rubocop/positional_arguments.rb
         
     | 
| 
      
 167 
     | 
    
         
            +
            - lib/statsd/instrument/rubocop/splat_arguments.rb
         
     | 
| 
      
 168 
     | 
    
         
            +
            - lib/statsd/instrument/statsd_datagram_builder.rb
         
     | 
| 
      
 169 
     | 
    
         
            +
            - lib/statsd/instrument/strict.rb
         
     | 
| 
      
 170 
     | 
    
         
            +
            - lib/statsd/instrument/udp_sink.rb
         
     | 
| 
       130 
171 
     | 
    
         
             
            - lib/statsd/instrument/version.rb
         
     | 
| 
       131 
172 
     | 
    
         
             
            - shipit.rubygems.yml
         
     | 
| 
       132 
173 
     | 
    
         
             
            - statsd-instrument.gemspec
         
     | 
| 
       133 
174 
     | 
    
         
             
            - test/assertions_test.rb
         
     | 
| 
      
 175 
     | 
    
         
            +
            - test/benchmark/clock_gettime.rb
         
     | 
| 
      
 176 
     | 
    
         
            +
            - test/benchmark/default_tags.rb
         
     | 
| 
       134 
177 
     | 
    
         
             
            - test/benchmark/metrics.rb
         
     | 
| 
       135 
178 
     | 
    
         
             
            - test/benchmark/tags.rb
         
     | 
| 
       136 
179 
     | 
    
         
             
            - test/capture_backend_test.rb
         
     | 
| 
      
 180 
     | 
    
         
            +
            - test/capture_sink_test.rb
         
     | 
| 
      
 181 
     | 
    
         
            +
            - test/client_test.rb
         
     | 
| 
      
 182 
     | 
    
         
            +
            - test/compatibility/dogstatsd_datagram_compatibility_test.rb
         
     | 
| 
      
 183 
     | 
    
         
            +
            - test/datagram_builder_test.rb
         
     | 
| 
      
 184 
     | 
    
         
            +
            - test/deprecations_test.rb
         
     | 
| 
      
 185 
     | 
    
         
            +
            - test/dogstatsd_datagram_builder_test.rb
         
     | 
| 
       137 
186 
     | 
    
         
             
            - test/environment_test.rb
         
     | 
| 
      
 187 
     | 
    
         
            +
            - test/helpers/rubocop_helper.rb
         
     | 
| 
       138 
188 
     | 
    
         
             
            - test/helpers_test.rb
         
     | 
| 
       139 
189 
     | 
    
         
             
            - test/integration_test.rb
         
     | 
| 
      
 190 
     | 
    
         
            +
            - test/log_sink_test.rb
         
     | 
| 
       140 
191 
     | 
    
         
             
            - test/logger_backend_test.rb
         
     | 
| 
       141 
192 
     | 
    
         
             
            - test/matchers_test.rb
         
     | 
| 
       142 
193 
     | 
    
         
             
            - test/metric_test.rb
         
     | 
| 
      
 194 
     | 
    
         
            +
            - test/null_sink_test.rb
         
     | 
| 
      
 195 
     | 
    
         
            +
            - test/rubocop/measure_as_dist_argument_test.rb
         
     | 
| 
      
 196 
     | 
    
         
            +
            - test/rubocop/metaprogramming_positional_arguments_test.rb
         
     | 
| 
      
 197 
     | 
    
         
            +
            - test/rubocop/metric_prefix_argument_test.rb
         
     | 
| 
      
 198 
     | 
    
         
            +
            - test/rubocop/metric_return_value_test.rb
         
     | 
| 
      
 199 
     | 
    
         
            +
            - test/rubocop/metric_value_keyword_argument_test.rb
         
     | 
| 
      
 200 
     | 
    
         
            +
            - test/rubocop/positional_arguments_test.rb
         
     | 
| 
      
 201 
     | 
    
         
            +
            - test/rubocop/splat_arguments_test.rb
         
     | 
| 
      
 202 
     | 
    
         
            +
            - test/statsd_datagram_builder_test.rb
         
     | 
| 
       143 
203 
     | 
    
         
             
            - test/statsd_instrumentation_test.rb
         
     | 
| 
       144 
204 
     | 
    
         
             
            - test/statsd_test.rb
         
     | 
| 
       145 
205 
     | 
    
         
             
            - test/test_helper.rb
         
     | 
| 
       146 
206 
     | 
    
         
             
            - test/udp_backend_test.rb
         
     | 
| 
      
 207 
     | 
    
         
            +
            - test/udp_sink_test.rb
         
     | 
| 
       147 
208 
     | 
    
         
             
            homepage: https://github.com/Shopify/statsd-instrument
         
     | 
| 
       148 
209 
     | 
    
         
             
            licenses:
         
     | 
| 
       149 
210 
     | 
    
         
             
            - MIT
         
     | 
| 
         @@ -163,23 +224,42 @@ required_rubygems_version: !ruby/object:Gem::Requirement 
     | 
|
| 
       163 
224 
     | 
    
         
             
                - !ruby/object:Gem::Version
         
     | 
| 
       164 
225 
     | 
    
         
             
                  version: '0'
         
     | 
| 
       165 
226 
     | 
    
         
             
            requirements: []
         
     | 
| 
       166 
     | 
    
         
            -
             
     | 
| 
       167 
     | 
    
         
            -
            rubygems_version: 2.7.6
         
     | 
| 
      
 227 
     | 
    
         
            +
            rubygems_version: 3.0.3
         
     | 
| 
       168 
228 
     | 
    
         
             
            signing_key: 
         
     | 
| 
       169 
229 
     | 
    
         
             
            specification_version: 4
         
     | 
| 
       170 
230 
     | 
    
         
             
            summary: A StatsD client for Ruby apps
         
     | 
| 
       171 
231 
     | 
    
         
             
            test_files:
         
     | 
| 
       172 
232 
     | 
    
         
             
            - test/assertions_test.rb
         
     | 
| 
      
 233 
     | 
    
         
            +
            - test/benchmark/clock_gettime.rb
         
     | 
| 
      
 234 
     | 
    
         
            +
            - test/benchmark/default_tags.rb
         
     | 
| 
       173 
235 
     | 
    
         
             
            - test/benchmark/metrics.rb
         
     | 
| 
       174 
236 
     | 
    
         
             
            - test/benchmark/tags.rb
         
     | 
| 
       175 
237 
     | 
    
         
             
            - test/capture_backend_test.rb
         
     | 
| 
      
 238 
     | 
    
         
            +
            - test/capture_sink_test.rb
         
     | 
| 
      
 239 
     | 
    
         
            +
            - test/client_test.rb
         
     | 
| 
      
 240 
     | 
    
         
            +
            - test/compatibility/dogstatsd_datagram_compatibility_test.rb
         
     | 
| 
      
 241 
     | 
    
         
            +
            - test/datagram_builder_test.rb
         
     | 
| 
      
 242 
     | 
    
         
            +
            - test/deprecations_test.rb
         
     | 
| 
      
 243 
     | 
    
         
            +
            - test/dogstatsd_datagram_builder_test.rb
         
     | 
| 
       176 
244 
     | 
    
         
             
            - test/environment_test.rb
         
     | 
| 
      
 245 
     | 
    
         
            +
            - test/helpers/rubocop_helper.rb
         
     | 
| 
       177 
246 
     | 
    
         
             
            - test/helpers_test.rb
         
     | 
| 
       178 
247 
     | 
    
         
             
            - test/integration_test.rb
         
     | 
| 
      
 248 
     | 
    
         
            +
            - test/log_sink_test.rb
         
     | 
| 
       179 
249 
     | 
    
         
             
            - test/logger_backend_test.rb
         
     | 
| 
       180 
250 
     | 
    
         
             
            - test/matchers_test.rb
         
     | 
| 
       181 
251 
     | 
    
         
             
            - test/metric_test.rb
         
     | 
| 
      
 252 
     | 
    
         
            +
            - test/null_sink_test.rb
         
     | 
| 
      
 253 
     | 
    
         
            +
            - test/rubocop/measure_as_dist_argument_test.rb
         
     | 
| 
      
 254 
     | 
    
         
            +
            - test/rubocop/metaprogramming_positional_arguments_test.rb
         
     | 
| 
      
 255 
     | 
    
         
            +
            - test/rubocop/metric_prefix_argument_test.rb
         
     | 
| 
      
 256 
     | 
    
         
            +
            - test/rubocop/metric_return_value_test.rb
         
     | 
| 
      
 257 
     | 
    
         
            +
            - test/rubocop/metric_value_keyword_argument_test.rb
         
     | 
| 
      
 258 
     | 
    
         
            +
            - test/rubocop/positional_arguments_test.rb
         
     | 
| 
      
 259 
     | 
    
         
            +
            - test/rubocop/splat_arguments_test.rb
         
     | 
| 
      
 260 
     | 
    
         
            +
            - test/statsd_datagram_builder_test.rb
         
     | 
| 
       182 
261 
     | 
    
         
             
            - test/statsd_instrumentation_test.rb
         
     | 
| 
       183 
262 
     | 
    
         
             
            - test/statsd_test.rb
         
     | 
| 
       184 
263 
     | 
    
         
             
            - test/test_helper.rb
         
     | 
| 
       185 
264 
     | 
    
         
             
            - test/udp_backend_test.rb
         
     | 
| 
      
 265 
     | 
    
         
            +
            - test/udp_sink_test.rb
         
     |