Shopify / statsd-instrument

A StatsD client for Ruby apps. Provides metaprogramming methods to inject StatsD instrumentation into your code.
http://shopify.github.io/statsd-instrument
MIT License
574 stars 97 forks source link

Add a Strict monkeypatch to find deprecated behavior #183

Closed wvanbergen closed 5 years ago

wvanbergen commented 5 years ago

Adds a Strict monkeypatch that strictly validates the arguments provided to StatsD methods for correct usage. You can enable this in CI of a project by adding require 'statsd/instrument/strict', to fin deprecated behavior that may no longer work in the future.

wvanbergen commented 5 years ago

This is definitely not ready, but some early feedback would be welcome!

dylanahsmith commented 5 years ago

Should we use sorbet for type checking? I think we can even have the sorbet rbi file get generated from the documentation to provide that type checking. We should be able to use the sorbet runtime during testing and not use it for production (using sorbet stubs to ignore any inline annotations in the application).

wvanbergen commented 5 years ago

So this is working pretty well, and has helped me find many issues in our StatsD usage.

What is still missing is s strict monkeypatch for the metaprgramming methods. I rather add that in a separate PR, so we can review and merge this one.