mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-16 10:21:42 +00:00
fixup! refactorizar rollups recursivos
This commit is contained in:
parent
c09df3b87b
commit
47a74b5848
1 changed files with 2 additions and 1 deletions
|
@ -12,6 +12,7 @@ class StatCollectionJob < PeriodicJob
|
||||||
|
|
||||||
# Registrar que se hicieron todas las recolecciones
|
# Registrar que se hicieron todas las recolecciones
|
||||||
stat = site.stats.create! name: STAT_NAME
|
stat = site.stats.create! name: STAT_NAME
|
||||||
|
beginning = beginning_of_interval
|
||||||
|
|
||||||
scope.rollup('builds', **options)
|
scope.rollup('builds', **options)
|
||||||
|
|
||||||
|
@ -25,7 +26,7 @@ class StatCollectionJob < PeriodicJob
|
||||||
|
|
||||||
# XXX: Es correcto promediar promedios?
|
# XXX: Es correcto promediar promedios?
|
||||||
Stat::INTERVALS.reduce do |previous, current|
|
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: 'builds', **opts)
|
||||||
recursive_rollup(name: 'space_used', operation: :average, **opts)
|
recursive_rollup(name: 'space_used', operation: :average, **opts)
|
||||||
|
|
Loading…
Reference in a new issue