Class: ActiveRecord::RuntimeRegistry::Stats
- Inherits:
-
Object
- Object
- ActiveRecord::RuntimeRegistry::Stats
- Defined in:
- lib/active_record/runtime_registry.rb
Overview
:nodoc:
Instance Attribute Summary collapse
-
#async_sql_runtime ⇒ Object
Returns the value of attribute async_sql_runtime.
-
#cached_queries_count ⇒ Object
Returns the value of attribute cached_queries_count.
-
#queries_count ⇒ Object
Returns the value of attribute queries_count.
-
#sql_runtime ⇒ Object
Returns the value of attribute sql_runtime.
Instance Method Summary collapse
-
#initialize ⇒ Stats
(also: #reset)
constructor
A new instance of Stats.
- #reset_runtimes ⇒ Object
Constructor Details
#initialize ⇒ Stats Also known as: reset
Returns a new instance of Stats.
13 14 15 16 17 18 |
# File 'lib/active_record/runtime_registry.rb', line 13 def initialize @sql_runtime = 0.0 @async_sql_runtime = 0.0 @queries_count = 0 @cached_queries_count = 0 end |
Instance Attribute Details
#async_sql_runtime ⇒ Object
Returns the value of attribute async_sql_runtime.
11 12 13 |
# File 'lib/active_record/runtime_registry.rb', line 11 def async_sql_runtime @async_sql_runtime end |
#cached_queries_count ⇒ Object
Returns the value of attribute cached_queries_count.
11 12 13 |
# File 'lib/active_record/runtime_registry.rb', line 11 def cached_queries_count @cached_queries_count end |
#queries_count ⇒ Object
Returns the value of attribute queries_count.
11 12 13 |
# File 'lib/active_record/runtime_registry.rb', line 11 def queries_count @queries_count end |
#sql_runtime ⇒ Object
Returns the value of attribute sql_runtime.
11 12 13 |
# File 'lib/active_record/runtime_registry.rb', line 11 def sql_runtime @sql_runtime end |
Instance Method Details
#reset_runtimes ⇒ Object
20 21 22 23 24 25 |
# File 'lib/active_record/runtime_registry.rb', line 20 def reset_runtimes sql_runtime_was = @sql_runtime @sql_runtime = 0.0 @async_sql_runtime = 0.0 sql_runtime_was end |