Skip to content

Instantly share code, notes, and snippets.

@kyuden
Created May 5, 2013 12:17
Show Gist options
  • Save kyuden/5520678 to your computer and use it in GitHub Desktop.
Save kyuden/5520678 to your computer and use it in GitHub Desktop.
action-banchmark around_filter (ver2)
class BenchmarkFilter
def filter(controller)
timer = Time.now
Rails.logger.debug do
"- Action #{controller.action_name} started. |"
end
yield
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