Class: GoodJob::PerformanceController

Inherits:
ApplicationController show all
Defined in:
app/controllers/good_job/performance_controller.rb

Instance Method Summary collapse

Instance Method Details

#indexObject



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

def index
  @performances = GoodJob::DiscreteExecution
                  .where.not(job_class: nil)
                  .group(:job_class)
                  .select("
                        job_class,
                        COUNT(*) AS executions_count,
                        AVG(duration) AS avg_duration,
                        MIN(duration) AS min_duration,
                        MAX(duration) AS max_duration
                      ")
                  .order("job_class")
end