5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-16 10:41:41 +00:00

fixup! refactorizar rollups recursivos

This commit is contained in:
f 2022-04-23 20:33:58 -03:00
parent c09df3b87b
commit 47a74b5848

View file

@ -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)