Adds passing blocks to instrumented methods #17

Merged
merged 1 commit into from Jul 9, 2012

Projects

None yet

2 participants

@langalex
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
  end

  statsd_measure :update, 'User.update'
end

and I would call User.new.update {|u| u.email = '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
@jstorimer

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