Skip to content

Instantly share code, notes, and snippets.

View ajpalkovic's full-sized avatar

AJ Palkovic ajpalkovic

View GitHub Profile
@coldnebo
coldnebo / rails_trace.rb
Last active December 1, 2018 08:10
This Rack middleware for Rails3 lets you see a call-trace of the lines of ruby code in your application invoked during a single request. Only code within your app is considered (i.e. in the /app folder). This expands on my previous attempt (https://gist.github.com/3077744). Example of output in comments below.
require 'singleton'
# outputs a colored call-trace graph to the Rails logger of the lines of ruby code
# invoked during a single request.
#
# Example:
#
# 1) Make sure this file is loaded in an initializer
#
# 2) Add the following to your application.rb in Rails3: