Module: Blacklight::ControllerRuntime

Extended by:
ActiveSupport::Concern
Defined in:
app/controllers/concerns/blacklight/controller_runtime.rb

Overview

Adds Solr timing to the Rails request log line, mirroring how ActiveRecord::Railties::ControllerRuntime adds ActiveRecord timing, e.g.:

Completed 200 OK in 62ms (Views: 12.0ms | ActiveRecord: 1.2ms | Solr: 45.3ms (2 queries))

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Instance Method Details

#append_info_to_payload(payload) ⇒ Object (protected)



17
18
19
20
21
22
23
# File 'app/controllers/concerns/blacklight/controller_runtime.rb', line 17

def append_info_to_payload(payload)
  super
  stats = Blacklight::RuntimeRegistry.stats
  payload[:solr_runtime] = stats.solr_runtime
  payload[:solr_query_count] = stats.solr_query_count
  stats.reset
end

#process_action(action, *args) ⇒ Object (protected)



12
13
14
15
# File 'app/controllers/concerns/blacklight/controller_runtime.rb', line 12

def process_action(action, *args)
  Blacklight::RuntimeRegistry.stats.reset
  super
end