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

Inject client into Expectation object so we can find the correct prefix. #231

Closed wvanbergen closed 5 years ago

wvanbergen commented 5 years ago

The Expectation object still has some dependencies on the singleton. This fixes one of them.

In the future, I am not sure if I actually want to keep automatically adding the StatsD prefix. I kind of like having to explicitly add it to the metric names in your tests, to really assert that the metrics you are emitting are what you expect them to be. However, that would break many tests, so for now I decided to go for this simple fix.