Module: Octave::Helpers::Controller
- Defined in:
- lib/octave/helpers/controller.rb
Overview
Instance Method Summary collapse
-
#measure_action(&block) ⇒ Object
Measures the duration of the action.
-
#measure_action_name ⇒ Object
The name of the metric.
Instance Method Details
#measure_action(&block) ⇒ Object
Measures the duration of the action.
Example
around_action :measure_action, only: %i[create update destroy]
17 18 19 |
# File 'lib/octave/helpers/controller.rb', line 17 def measure_action(&block) Octave.measure(measure_action_name, &block) end |
#measure_action_name ⇒ Object
The name of the metric. Default is #{controller_name}.#{action_name}
. Override this method if you would like to specify your own name.
24 25 26 |
# File 'lib/octave/helpers/controller.rb', line 24 def measure_action_name [controller_name, action_name].join(".") end |