Class: ActiveRecord::RuntimeRegistry::Stats

Inherits:
Object
  • Object
show all
Defined in:
lib/active_record/runtime_registry.rb

Overview

:nodoc:

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeStats 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_runtimeObject

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_countObject

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_countObject

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_runtimeObject

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_runtimesObject



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