Class: SolidWebUi::Cable::DashboardController

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

Instance Method Summary collapse

Instance Method Details

#indexObject



5
6
7
8
9
10
11
# File 'app/controllers/solid_web_ui/cable/dashboard_controller.rb', line 5

def index
  @total = SolidCable::Message.count
  @channel_count = SolidCable::Message.distinct.count(:channel)
  @trimmable = trimmable_scope.count
  @last_hour = SolidCable::Message.where(created_at: 1.hour.ago..).count
  @top_channels = SolidCable::Message.group(:channel).count.max_by(10) { |_channel, count| count }
end