Skip to content

Instantly share code, notes, and snippets.

View MiroslavCsonka's full-sized avatar

Miroslav Csonka MiroslavCsonka

View GitHub Profile
def trace_method(filter)
trace = TracePoint.trace(:call) do |tp|
p [tp.event, Time.now.to_f, "#{tp.path}:#{tp.lineno}", tp.defined_class.name, tp.method_id] if tp.path =~ /#{filter}/i
end
trace.enable
yield
trace.disable
end