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
570 stars 94 forks source link

Return truish void from metric methods #237

Closed wvanbergen closed 4 years ago

wvanbergen commented 4 years ago

We broke backwards compatibility with the previous client by not returning metric objects when calling StatsD metric methods anymore. However, in some cases code depends on the return value of these methods to evaluate to true, because they are used as last statement in a block, which end sup being evaluated as an expression in if statements. It is basically impossible to detect people depending on this return value being evaluated to true.

So rather than returning nil, I propose we return a useless object that evaluates to true so not introduce accidental bugs by migrating to the new version.