Class: SolidStackWeb::CacheTimeline
- Inherits:
-
Object
- Object
- SolidStackWeb::CacheTimeline
- Defined in:
- app/models/solid_stack_web/cache_timeline.rb
Constant Summary collapse
- HOURS =
24
Instance Method Summary collapse
Instance Method Details
#byte_buckets ⇒ Object
9 10 11 |
# File 'app/models/solid_stack_web/cache_timeline.rb', line 9 def byte_buckets @byte_buckets ||= build_buckets { |rows, from, to| rows.sum { |t, b| t >= from && t < to ? b : 0 } } end |
#byte_max ⇒ Object
17 18 19 |
# File 'app/models/solid_stack_web/cache_timeline.rb', line 17 def byte_max byte_buckets.max || 0 end |
#entry_buckets ⇒ Object
5 6 7 |
# File 'app/models/solid_stack_web/cache_timeline.rb', line 5 def entry_buckets @entry_buckets ||= build_buckets { |rows, from, to| rows.count { |t, _| t >= from && t < to } } end |
#entry_max ⇒ Object
13 14 15 |
# File 'app/models/solid_stack_web/cache_timeline.rb', line 13 def entry_max entry_buckets.max || 0 end |