Class: SidekiqInsight::DashboardController

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

Instance Method Summary collapse

Instance Method Details

#clearObject



14
15
16
17
# File 'app/controllers/sidekiq_insight/dashboard_controller.rb', line 14

def clear
  SidekiqInsight.storage.clear_all
  redirect_to sidekiq_insight.root_path, notice: "Cleared profiler data"
end

#indexObject



3
4
5
6
# File 'app/controllers/sidekiq_insight/dashboard_controller.rb', line 3

def index
  @jobs = SidekiqInsight.storage.top_jobs(50)
  @alerts = SidekiqInsight.detector.recent_alerts(20)
end

#showObject



8
9
10
11
12
# File 'app/controllers/sidekiq_insight/dashboard_controller.rb', line 8

def show
  key = params[:job]
  @samples = SidekiqInsight.storage.recent(key, 200)
  @leak = SidekiqInsight::Metrics.detect_leak(@samples)
end