Class: SolidObserver::CacheDashboardController

Inherits:
DashboardController show all
Defined in:
app/controllers/solid_observer/cache_dashboard_controller.rb

Constant Summary collapse

CACHE_STORAGE_COMPONENTS =
%w[solid_cache cache_observer].freeze

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from DashboardController

#live_poll, #poll_data

Methods inherited from ApplicationController

runtime_db_errors

Class Method Details

.cache_dashboard_assignments(range_param:) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'app/controllers/solid_observer/cache_dashboard_controller.rb', line 10

def cache_dashboard_assignments(range_param:)
  return unavailable_assignments unless SolidObserver.config.solid_cache_enabled?

  range = SolidObserver::Services::CacheStats.parse_range(range_param)
  window = SolidObserver::Services::CacheStats.range_duration(range)
  stats = SolidObserver::Services::CacheStats.call(window: window)

  {
    cache_dashboard_available: true,
    range: range,
    stats: stats,
    activity_trends: stats[:activity_trends],
    stability: stats[:stability],
    storage_components: cache_storage_components,
    recent_events: recent_events(window)
  }
end

Instance Method Details

#indexObject



54
55
56
57
# File 'app/controllers/solid_observer/cache_dashboard_controller.rb', line 54

def index
  @component = "cache"
  assign_cache_dashboard
end