Class: Dbwatcher::DashboardController

Inherits:
BaseController
  • Object
show all
Defined in:
app/controllers/dbwatcher/dashboard_controller.rb

Instance Method Summary collapse

Instance Method Details

#clear_allObject



20
21
22
23
24
25
26
# File 'app/controllers/dbwatcher/dashboard_controller.rb', line 20

def clear_all
  clear_storage_with_message(
    -> { Storage.clear_all },
    "All sessions and SQL logs",
    root_path
  )
end

#indexObject



5
6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'app/controllers/dbwatcher/dashboard_controller.rb', line 5

def index
  dashboard_data = Dbwatcher::Services::DashboardDataAggregator.call
  @recent_sessions = dashboard_data[:recent_sessions]
  @active_tables = dashboard_data[:active_tables]
  @query_stats = dashboard_data[:query_stats]
  @active_tab = params[:tab] || "overview"

  # Add system information if enabled
  return unless Dbwatcher.configuration.system_info

  @system_info_summary = system_info_storage.summary
  @system_info = system_info_storage.cached_info
  @info_age = system_info_storage.info_age
end