Add a dashboard warning when sidekiq queue has more than 100 jobs

This commit is contained in:
Neil Lalonde
2013-04-22 13:02:24 -04:00
parent f980b4d16e
commit ae487e740c
2 changed files with 7 additions and 1 deletions

View File

@ -40,7 +40,7 @@ class AdminDashboardData
end
def problems
[rails_env_check, host_names_check, gc_checks, sidekiq_check || clockwork_check, ram_check, facebook_config_check, twitter_config_check, github_config_check].compact
[rails_env_check, host_names_check, gc_checks, sidekiq_check || queue_size_check || clockwork_check, ram_check, facebook_config_check, twitter_config_check, github_config_check].compact
end
def rails_env_check
@ -64,6 +64,11 @@ class AdminDashboardData
I18n.t('dashboard.clockwork_warning') unless Jobs::ClockworkHeartbeat.is_clockwork_running?
end
def queue_size_check
queue_size = Jobs.queued
I18n.t('dashboard.queue_size_warning', queue_size: queue_size) unless queue_size < 100
end
def ram_check
I18n.t('dashboard.memory_warning') if MemInfo.new.mem_total and MemInfo.new.mem_total < 1_000_000
end