mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-22 01:56:21 +00:00
procesar las estadísticas automáticamente
This commit is contained in:
parent
6f45756e6d
commit
00f303cf20
3 changed files with 17 additions and 0 deletions
1
Procfile
1
Procfile
|
@ -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
11
lib/tasks/stats.rake
Normal 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
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue