module Watchman::Rails::ControllerBenchmark

Public Class Methods

included(base) click to toggle source
# File lib/watchman/rails/controller_benchmark.rb, line 5
def self.included(base)
  base.class_eval do
    around_action :watchman_rails_controller_benchmark
  end
end

Public Instance Methods

watchman_rails_controller_benchmark() { || ... } click to toggle source
# File lib/watchman/rails/controller_benchmark.rb, line 11
def watchman_rails_controller_benchmark
  bench_controller_name = self.class
                              .name
                              .underscore
                              .gsub("/", "_")
                              .gsub(/_controller$/, "")

  Watchman.benchmark("rails.controllers", :tags => [bench_controller_name, action_name]) { yield }
end