Adds passing blocks to instrumented methods #17

merged 1 commit into from Jul 9, 2012


None yet

2 participants

langalex commented Jul 5, 2012

Before when I instrumented a method that expected a block, e.g.

class User
  extend StatsD::Instrument

  def update(&block)
    yield self

  statsd_measure :update, 'User.update'

and I would call {|u| = 'xyz'} the block would not get passes to the method.

This patch fixes it for all four methods (measure, count, count_if, count_success).

@jstorimer jstorimer merged commit e42bbea into Shopify:master Jul 9, 2012

Thanks, just merged and released it as part of 1.3.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment