Class: Insight::RedisPanel
- Defined in:
- lib/insight/panels/redis_panel.rb,
lib/insight/panels/redis_panel/stats.rb
Defined Under Namespace
Classes: Stats
Instance Attribute Summary
Attributes inherited from Panel
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from Panel
#after, #before, #call, #content_for_request, current_panel_file, excluded, file_index, from_file, #has_content?, #heading_for_request, inherited, #initialize, #panel_app, panel_exclusion, panel_mappings, #render
Methods included from Instrumentation::Client
#after_detect, #before_detect, #probe, #request_finish, #request_start
Methods included from Logging
Methods included from Database::RequestDataClient
#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 Insight::Panel
Class Method Details
.record(redis_command_args, backtrace, &block) ⇒ Object
8 9 10 11 12 13 14 15 16 |
# File 'lib/insight/panels/redis_panel.rb', line 8 def self.record(redis_command_args, backtrace, &block) return block.call unless Insight.enabled? start_time = Time.now result = block.call total_time = Time.now - start_time stats.record_call(total_time * 1_000, redis_command_args, backtrace) return result end |
Instance Method Details
#content ⇒ Object
34 35 36 37 38 |
# File 'lib/insight/panels/redis_panel.rb', line 34 def content result = render_template "panels/redis", :stats => self.class.stats self.class.reset return result end |
#heading ⇒ Object
30 31 32 |
# File 'lib/insight/panels/redis_panel.rb', line 30 def heading "Redis: %.2fms (#{self.class.stats.queries.size} calls)" % self.class.stats.time end |
#name ⇒ Object
26 27 28 |
# File 'lib/insight/panels/redis_panel.rb', line 26 def name "redis" end |