Sha256: 0df9a1cc1e2c937f963cec54cf7c02e4f8b5dc0cd876eb34f03ac56d7a234fd9
Contents?: true
Size: 1.06 KB
Versions: 15
Compression:
Stored size: 1.06 KB
Contents
# frozen_string_literal: true module GoodJob class MetricsController < ApplicationController def primary_nav jobs_count = GoodJob::Job.count batches_count = GoodJob::BatchRecord.migrated? ? GoodJob::BatchRecord.all.size : 0 cron_entries_count = GoodJob::CronEntry.all.size processes_count = GoodJob::Process.active.count render json: { jobs_count: number_to_human(jobs_count), batches_count: number_to_human(batches_count), cron_entries_count: number_to_human(cron_entries_count), processes_count: number_to_human(processes_count), } end def job_status @filter = JobsFilter.new(params) render json: @filter.states.transform_values { |count| number_with_delimiter(count) } end private def number_to_human(count) helpers.number_to_human(count, **helpers.translate_hash("good_job.number.human.decimal_units")) end def number_with_delimiter(count) helpers.number_with_delimiter(count, **helpers.translate_hash('good_job.number.format')) end end end
Version data entries
15 entries across 15 versions & 1 rubygems