Class: ActiveInsights::JobsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/active_insights/jobs_controller.rb

Instance Method Summary collapse

Instance Method Details

#indexObject



5
6
7
8
9
10
11
# File 'app/controllers/active_insights/jobs_controller.rb', line 5

def index
  @jobs = base_jobs_scope.with_durations.select(:job, :queue).
          group(:job, :queue).sort_by(&:agony).reverse

  @latency =
    base_jobs_scope.select("AVG(queue_time) as latency").to_a.first.latency
end