Class: MemoryTracker::Stores::InMemoryStore::StatInterval
- Inherits:
-
Object
- Object
- MemoryTracker::Stores::InMemoryStore::StatInterval
- Extended by:
- Forwardable
- Includes:
- Enumerable
- Defined in:
- lib/memory_tracker/stores/in_memory_store.rb
Instance Attribute Summary collapse
-
#duration ⇒ Object
readonly
Returns the value of attribute duration.
-
#size ⇒ Object
readonly
Returns the value of attribute size.
-
#start_time ⇒ Object
readonly
Returns the value of attribute start_time.
-
#stats ⇒ Object
readonly
Returns the value of attribute stats.
Instance Method Summary collapse
-
#initialize(start_time, duration_seconds) ⇒ StatInterval
constructor
A new instance of StatInterval.
- #push(request) ⇒ Object
Constructor Details
#initialize(start_time, duration_seconds) ⇒ StatInterval
Returns a new instance of StatInterval.
43 44 45 46 47 48 |
# File 'lib/memory_tracker/stores/in_memory_store.rb', line 43 def initialize(start_time, duration_seconds) @start_time = start_time @duration = duration_seconds @size = 0 @stats = Stats.new end |
Instance Attribute Details
#duration ⇒ Object (readonly)
Returns the value of attribute duration.
36 37 38 |
# File 'lib/memory_tracker/stores/in_memory_store.rb', line 36 def duration @duration end |
#size ⇒ Object (readonly)
Returns the value of attribute size.
36 37 38 |
# File 'lib/memory_tracker/stores/in_memory_store.rb', line 36 def size @size end |
#start_time ⇒ Object (readonly)
Returns the value of attribute start_time.
36 37 38 |
# File 'lib/memory_tracker/stores/in_memory_store.rb', line 36 def start_time @start_time end |
#stats ⇒ Object (readonly)
Returns the value of attribute stats.
36 37 38 |
# File 'lib/memory_tracker/stores/in_memory_store.rb', line 36 def stats @stats end |
Instance Method Details
#push(request) ⇒ Object
50 51 52 53 54 55 56 57 |
# File 'lib/memory_tracker/stores/in_memory_store.rb', line 50 def push(request) @size += 1 delta = request.gcstat_delta.stats @stats.increment_action_count(request.controller, request.action) delta.each_key do |attr| @stats.increment_action_attribute(request.controller, request.action, attr, delta[attr]) end end |