procesar las estadísticas automáticamente

This commit is contained in:
f 2022-06-11 19:42:55 -03:00
parent 6f45756e6d
commit 00f303cf20
3 changed files with 17 additions and 0 deletions

View File

@ -5,3 +5,4 @@ blazer_1h: bundle exec rake blazer:run_checks SCHEDULE="1 hour"
blazer_1d: bundle exec rake blazer:run_checks SCHEDULE="1 day"
blazer: bundle exec rake blazer:send_failing_checks
prometheus: bundle exec prometheus_exporter -b 0.0.0.0 --prefix "sutty_"
stats: bundle exec rake stats:process_all

11
lib/tasks/stats.rake Normal file
View File

@ -0,0 +1,11 @@
# frozen_string_literal: true
namespace :stats do
desc 'Process stats'
task process_all: :environment do
Site.all.pluck(:id).each do |site_id|
UriCollectionJob.perform_now site_id: site_id, once: true
StatCollectionJob.perform_now site_id: site_id, once: true
end
end
end

View File

@ -30,3 +30,8 @@ check program access_logs
with path "/srv/http/bin/access_logs" as uid "app" and gid "www-data"
every "0 0 * * *"
if status != 0 then alert
check program stats
with path "/usr/bin/foreman run -f /srv/Procfile -d /srv stats" as uid "rails" gid "www-data"
every "0 1 * * *"
if status != 0 then alert