ActiveSupport::Benchmarkable

module ActiveSupport::Benchmarkable

Public Instance Methods

benchmark(message = "Benchmarking", options = {}) { || ... } Show source

Allows you to measure the execution time of a block in a template and records the result to the log. Wrap this block around expensive operations or possible bottlenecks to get a time reading for the operation. For example, let's say you thought your file processing method was taking too long; you could wrap it in a benchmark block.

<% benchmark 'Process data files' do %>
  <%= expen