From 47a74b584824001e81d1bc1be86c6333ba2099b0 Mon Sep 17 00:00:00 2001 From: f Date: Sat, 23 Apr 2022 20:33:58 -0300 Subject: [PATCH] fixup! refactorizar rollups recursivos --- app/jobs/stat_collection_job.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/jobs/stat_collection_job.rb b/app/jobs/stat_collection_job.rb index 03dcd292..fcb4d6e1 100644 --- a/app/jobs/stat_collection_job.rb +++ b/app/jobs/stat_collection_job.rb @@ -12,6 +12,7 @@ class StatCollectionJob < PeriodicJob # Registrar que se hicieron todas las recolecciones stat = site.stats.create! name: STAT_NAME + beginning = beginning_of_interval scope.rollup('builds', **options) @@ -25,7 +26,7 @@ class StatCollectionJob < PeriodicJob # XXX: Es correcto promediar promedios? Stat::INTERVALS.reduce do |previous, current| - opts = { interval_previous: previous, interval: current, dimensions: { site_id: site.id } } + opts = { interval_previous: previous, interval: current, beginning: beginning, dimensions: { site_id: site.id } } recursive_rollup(name: 'builds', **opts) recursive_rollup(name: 'space_used', operation: :average, **opts)