Class: Rack::Insight::SphinxPanel
- Defined in:
- lib/rack/insight/panels/sphinx_panel.rb,
lib/rack/insight/panels/sphinx_panel/stats.rb
Defined Under Namespace
Classes: Stats
Instance Attribute Summary
Attributes inherited from Panel
Instance Method Summary collapse
- #after_detect(method_call, timing, args, message) ⇒ Object
- #content_for_request(number) ⇒ Object
- #heading_for_request(number) ⇒ Object
- #request_finish(env, status, headers, body, timing) ⇒ Object
- #request_start(env, start) ⇒ Object
Methods inherited from Panel
#after, #before, #bool_prop, #call, #camelized_name, #content, current_panel_file, excluded, file_index, from_file, #handle_error_for, #has_content?, #has_custom_probes?, has_table, #has_table?, #heading, inherited, #initialize, #inspect, #is_magic?, #is_probing?, #name, #panel_app, panel_exclusion, panel_mappings, #render, set_sub_class_template_root, #underscored_name
Methods included from Database::EigenClient
Methods included from Instrumentation::EigenClient
Methods included from Logging
Methods included from Instrumentation::Client
Methods included from Database::RequestDataClient
#count, #key_sql_template, #retrieve, #store, #table_length, #table_setup
Methods included from Render
#compile, #compile!, #compiled_source, #method_name, #method_name_without_locals, #render_template, #signed_params
Constructor Details
This class inherits a constructor from Rack::Insight::Panel
Instance Method Details
#after_detect(method_call, timing, args, message) ⇒ Object
14 15 16 |
# File 'lib/rack/insight/panels/sphinx_panel.rb', line 14 def after_detect(method_call, timing, args, ) @stats.record_call(timing.duration, args, method_call) end |
#content_for_request(number) ⇒ Object
23 24 25 |
# File 'lib/rack/insight/panels/sphinx_panel.rb', line 23 def content_for_request(number) render_template "panels/sphinx", :stats => retrieve(number).first end |
#heading_for_request(number) ⇒ Object
18 19 20 21 |
# File 'lib/rack/insight/panels/sphinx_panel.rb', line 18 def heading_for_request(number) stats = retrieve(number).first "Sphinx: %.2fms (#{stats.queries.size} calls)" % stats.time end |
#request_finish(env, status, headers, body, timing) ⇒ Object
9 10 11 12 |
# File 'lib/rack/insight/panels/sphinx_panel.rb', line 9 def request_finish(env, status, headers, body, timing) store(env, @stats) @stats = nil end |