23 Jan '13, 8pm

lmao if you don’t make it easy for users of your library to log, measure, and graph everything.

lmao if you don’t make it easy for users of your library to log, measure, and graph everything.

For the first time ever, I am going to lead with the end of the story. Here is the full ~30 lines that I will break down in detail during the rest of this post. require 'forwardable' module Foo module Instrumenters class Noop def self.instrument(name, payload = {}) yield payload if block_given? end end end class Client extend Forwardable def_delegator :@instrumenter, :instrument def initialize(options = {}) # some other setup for the client ... @instrumenter = options[:instrumenter] || Instrumenters::Noop end def execute(args = {}) instrument('client_execute.foo', args: args) { |payload| result = # do some work... payload[:result] = result result } end end end client = Foo::Client.new({ instrumenter: ActiveSupport::Notifications, }) client.execute(...) # I AM INSTRUMENTED!!! The Dark Side A while back, statsd grabbed a hold of the universe . It swept in like an elf on a un...

Full article: http://www.railstips.org/blog/archives/2013/01/23/an-inst...

Tweets

Oh, no, you don’t, Abdul Rashid

Oh, no, you don’t, Abdul Rashid

harismibrahim.wordpress.com 23 Jan '13, 7pm

“That can’t be true. I had nothing to do at all with this and I was never involved in issuing Ics.”What the EC did was onl...

New Tumblr Blog Raises Privacy Concerns Over Facebook Graph Search

New Tumblr Blog Raises Privacy Concerns Over Fa...

searchengineland.com 23 Jan '13, 9pm

That didn’t take long, did it? Tom Scott, one of the current users of Facebook Graph Search, has started a Tumblr blog to ...

Are you at #ALA2013? We arein Booth #903. Learn...

ieee.org 26 Jan '13, 4pm

What is the IEEE Xplore digital library? IEEE Xplore is a powerful search tool that delivers over 3 million research artic...

Just say “I don’t know.”

starbucksmelody.com 29 Jan '13, 4am

Which of these three words to use is tricky, and the really skilled in customer service can always seem to use the exact r...

How to make gasoline from tar sands, in six simple steps

How to make gasoline from tar sands, in six sim...

grist.org 23 Jan '13, 12pm

Ever wonder about the future of energy? Will it be wind? Solar? Geothermal? No wait, I got it, tar sands! (Let’s try that ...