Class: SolidObserver::DashboardController

Inherits:
ApplicationController show all
Defined in:
app/controllers/solid_observer/dashboard_controller.rb

Direct Known Subclasses

CacheDashboardController

Instance Method Summary collapse

Methods inherited from ApplicationController

runtime_db_errors

Instance Method Details

#indexObject



12
13
14
15
16
17
18
19
20
# File 'app/controllers/solid_observer/dashboard_controller.rb', line 12

def index
  @component = selected_component
  return assign_cache_dashboard if @component == "cache"

  return unless @component == "queue" && SolidObserver.config.solid_queue_enabled?

  assign_range_and_stats
  load_persistence_data if persistence_mode?
end

#live_pollObject



22
23
24
25
26
27
28
# File 'app/controllers/solid_observer/dashboard_controller.rb', line 22

def live_poll
  send_file(
    SolidObserver::Engine.root.join("app/assets/javascripts/solid_observer/live_poll.js"),
    type: "application/javascript; charset=utf-8",
    disposition: "inline"
  )
end

#poll_dataObject



30
31
32
33
34
35
# File 'app/controllers/solid_observer/dashboard_controller.rb', line 30

def poll_data
  range = QueueStats.parse_range(request_range_param, fallback: QueueStats::POLL_DEFAULT_RANGE)
  window = QueueStats.range_duration(range, fallback: QueueStats::POLL_DEFAULT_RANGE)
  append_chart_buffer
  render json: tick_request? ? tick_payload : full_payload(range: range, window: window)
end