Sam Saffron Programming, Technology and the Art of Hacking Lately I needed to add some instruments into Discourse. I wanted every request to measure: How many SQL statements and Redis commands are executed? How much time was spent in those sections? This can easily be abstracted to a more generalize problem of class ExternalClass def method_to_measure end end Solving this problem breaks down into