Sha256: 3949757b699ccd6c400b5efd66d6798fd69cc067b1e52f71c87196347a80c0a5

Contents?: true

Size: 791 Bytes

Versions: 8

Compression:

Stored size: 791 Bytes

Contents

# frozen_string_literal: true

module GoodJob
  class MetricsController < ApplicationController
    def primary_nav
      jobs_count = GoodJob::Job.count
      batches_count = GoodJob::BatchRecord.all.size
      cron_entries_count = GoodJob::CronEntry.all.size
      processes_count = GoodJob::Process.active.count

      render json: {
        jobs_count: helpers.number_to_human(jobs_count),
        batches_count: helpers.number_to_human(batches_count),
        cron_entries_count: helpers.number_to_human(cron_entries_count),
        processes_count: helpers.number_to_human(processes_count),
      }
    end

    def job_status
      @filter = JobsFilter.new(params)

      render json: @filter.states.transform_values { |count| helpers.number_with_delimiter(count) }
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
good_job-4.4.2 app/controllers/good_job/metrics_controller.rb
good_job-4.4.1 app/controllers/good_job/metrics_controller.rb
good_job-4.4.0 app/controllers/good_job/metrics_controller.rb
good_job-4.3.0 app/controllers/good_job/metrics_controller.rb
good_job-4.2.1 app/controllers/good_job/metrics_controller.rb
good_job-4.2.0 app/controllers/good_job/metrics_controller.rb
good_job-4.1.1 app/controllers/good_job/metrics_controller.rb
good_job-4.1.0 app/controllers/good_job/metrics_controller.rb