Skip to content

Instantly share code, notes, and snippets.

@kyuden
Created May 5, 2013 12:11
Show Gist options
  • Save kyuden/5520667 to your computer and use it in GitHub Desktop.
Save kyuden/5520667 to your computer and use it in GitHub Desktop.
action-benchmarck around_filter
class BenchmarkFilter
def before(controller)
@timer = Time.now
Rails.logger.debug do
"- Action #{controller.action_name} started. |"
end
end
def after(controller)
elaped_time = Time.now - @timer
Rails.logger.debug do
"- Action #{controller.action_name} finished in %0.3sec" % elaped_time
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment