Class: RailsRequestStats::RequestStats
- Inherits:
-
Object
- Object
- RailsRequestStats::RequestStats
- Defined in:
- lib/rails_request_stats/request_stats.rb
Instance Attribute Summary collapse
-
#action ⇒ Object
readonly
Returns the value of attribute action.
-
#database_query_stats ⇒ Object
readonly
Returns the value of attribute database_query_stats.
-
#format ⇒ Object
readonly
Returns the value of attribute format.
-
#method ⇒ Object
readonly
Returns the value of attribute method.
-
#object_space_stats ⇒ Object
readonly
Returns the value of attribute object_space_stats.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#runtime_stats ⇒ Object
readonly
Returns the value of attribute runtime_stats.
Instance Method Summary collapse
- #add_database_query_stats(query_count, cached_query_count) ⇒ Object
- #add_object_space_stats(before_object_space, after_object_space) ⇒ Object
- #add_runtime_stats(view_runtime, db_runtime) ⇒ Object
-
#initialize(key) ⇒ RequestStats
constructor
A new instance of RequestStats.
Constructor Details
#initialize(key) ⇒ RequestStats
Returns a new instance of RequestStats.
12 13 14 15 16 17 18 19 20 21 |
# File 'lib/rails_request_stats/request_stats.rb', line 12 def initialize(key) @action = key[:action] @format = key[:format] @method = key[:method] @path = key[:path] @database_query_stats = Stats::DatabaseQueryStats.new @object_space_stats = Stats::ObjectSpaceStats.new @runtime_stats = Stats::RuntimeStats.new end |
Instance Attribute Details
#action ⇒ Object (readonly)
Returns the value of attribute action.
3 4 5 |
# File 'lib/rails_request_stats/request_stats.rb', line 3 def action @action end |
#database_query_stats ⇒ Object (readonly)
Returns the value of attribute database_query_stats.
3 4 5 |
# File 'lib/rails_request_stats/request_stats.rb', line 3 def database_query_stats @database_query_stats end |
#format ⇒ Object (readonly)
Returns the value of attribute format.
3 4 5 |
# File 'lib/rails_request_stats/request_stats.rb', line 3 def format @format end |
#method ⇒ Object (readonly)
Returns the value of attribute method.
3 4 5 |
# File 'lib/rails_request_stats/request_stats.rb', line 3 def method @method end |
#object_space_stats ⇒ Object (readonly)
Returns the value of attribute object_space_stats.
3 4 5 |
# File 'lib/rails_request_stats/request_stats.rb', line 3 def object_space_stats @object_space_stats end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
3 4 5 |
# File 'lib/rails_request_stats/request_stats.rb', line 3 def path @path end |
#runtime_stats ⇒ Object (readonly)
Returns the value of attribute runtime_stats.
3 4 5 |
# File 'lib/rails_request_stats/request_stats.rb', line 3 def runtime_stats @runtime_stats end |
Instance Method Details
#add_database_query_stats(query_count, cached_query_count) ⇒ Object
23 24 25 |
# File 'lib/rails_request_stats/request_stats.rb', line 23 def add_database_query_stats(query_count, cached_query_count) @database_query_stats.add_stats(query_count, cached_query_count) end |
#add_object_space_stats(before_object_space, after_object_space) ⇒ Object
27 28 29 |
# File 'lib/rails_request_stats/request_stats.rb', line 27 def add_object_space_stats(before_object_space, after_object_space) @object_space_stats.add_stats(before_object_space, after_object_space) end |
#add_runtime_stats(view_runtime, db_runtime) ⇒ Object
31 32 33 |
# File 'lib/rails_request_stats/request_stats.rb', line 31 def add_runtime_stats(view_runtime, db_runtime) @runtime_stats.add_stats(view_runtime, db_runtime) end |