class RailsRequestStats::RequestStats
Attributes
action[R]
cache_stats[R]
database_query_stats[R]
format[R]
method[R]
object_space_stats[R]
path[R]
runtime_stats[R]
Public Class Methods
new(key)
click to toggle source
# 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
Public Instance Methods
add_cache_stats(cache_read_count, cache_hit_count)
click to toggle source
# 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)
click to toggle source
# 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)
click to toggle source
# 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)
click to toggle source
# 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