Class: RailsRequestStats::Stats::CacheStats

Inherits:
Object
  • Object
show all
Defined in:
lib/rails_request_stats/stats/cache_stats.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeCacheStats

Returns a new instance of CacheStats.



7
8
9
10
# File 'lib/rails_request_stats/stats/cache_stats.rb', line 7

def initialize
  @cache_read_count_collection = []
  @cache_hit_count_collection = []
end

Instance Attribute Details

#cache_hit_count_collectionObject (readonly)

Returns the value of attribute cache_hit_count_collection.



5
6
7
# File 'lib/rails_request_stats/stats/cache_stats.rb', line 5

def cache_hit_count_collection
  @cache_hit_count_collection
end

#cache_read_count_collectionObject (readonly)

Returns the value of attribute cache_read_count_collection.



4
5
6
# File 'lib/rails_request_stats/stats/cache_stats.rb', line 4

def cache_read_count_collection
  @cache_read_count_collection
end

Instance Method Details

#add_stats(cache_read_count, cache_hit_count) ⇒ Object



12
13
14
15
# File 'lib/rails_request_stats/stats/cache_stats.rb', line 12

def add_stats(cache_read_count, cache_hit_count)
  @cache_read_count_collection << cache_read_count
  @cache_hit_count_collection << cache_hit_count
end