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.
-
#cache_stats ⇒ Object
readonly
Returns the value of attribute cache_stats.
-
#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_cache_stats(cache_read_count, cache_hit_count) ⇒ Object
- #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.
13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/rails_request_stats/request_stats.rb', line 13 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 @cache_stats = Stats::CacheStats.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 |
#cache_stats ⇒ Object (readonly)
Returns the value of attribute cache_stats.
3 4 5 |
# File 'lib/rails_request_stats/request_stats.rb', line 3 def cache_stats @cache_stats 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_cache_stats(cache_read_count, cache_hit_count) ⇒ Object
37 38 39 |
# File 'lib/rails_request_stats/request_stats.rb', line 37 def add_cache_stats(cache_read_count, cache_hit_count) @cache_stats.add_stats(cache_read_count, cache_hit_count) end |
#add_database_query_stats(query_count, cached_query_count) ⇒ Object
25 26 27 |
# File 'lib/rails_request_stats/request_stats.rb', line 25 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
29 30 31 |
# File 'lib/rails_request_stats/request_stats.rb', line 29 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
33 34 35 |
# File 'lib/rails_request_stats/request_stats.rb', line 33 def add_runtime_stats(view_runtime, db_runtime) @runtime_stats.add_stats(view_runtime, db_runtime) end |