Sha256: c58808b9d29e2316944e3839f335bb78a238b7632f889cf1f407e9ecc1acca4c

Contents?: true

Size: 782 Bytes

Versions: 11

Compression:

Stored size: 782 Bytes

Contents

# frozen_string_literal: true

module GoodJob
  class PerformanceController < ApplicationController
    def index
      @performances = GoodJob::Execution
                      .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

    def show
      representative_job = GoodJob::Job.find_by!(job_class: params[:id])
      @job_class = representative_job.job_class
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
good_job-4.7.0 app/controllers/good_job/performance_controller.rb
good_job-4.6.0 app/controllers/good_job/performance_controller.rb
good_job-4.5.1 app/controllers/good_job/performance_controller.rb
good_job-4.5.0 app/controllers/good_job/performance_controller.rb
good_job-4.4.2 app/controllers/good_job/performance_controller.rb
good_job-4.4.1 app/controllers/good_job/performance_controller.rb
good_job-4.4.0 app/controllers/good_job/performance_controller.rb
good_job-4.3.0 app/controllers/good_job/performance_controller.rb
good_job-4.2.1 app/controllers/good_job/performance_controller.rb
good_job-4.2.0 app/controllers/good_job/performance_controller.rb
good_job-4.1.1 app/controllers/good_job/performance_controller.rb