mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-16 17:26:21 +00:00
fixup! no se puede renombrar un rollup usando dimensiones exactas
This commit is contained in:
parent
121d4f49e2
commit
b36bdc9763
2 changed files with 9 additions and 6 deletions
|
@ -30,14 +30,14 @@ module RecursiveRollup
|
||||||
#
|
#
|
||||||
# @param :name [String]
|
# @param :name [String]
|
||||||
# @param :new_name [String]
|
# @param :new_name [String]
|
||||||
# @param :interval_previous [String]
|
# @param :interval_previous [String, Symbol]
|
||||||
# @param :interval [String]
|
# @param :interval [String, Symbol]
|
||||||
# @param :operation [Symbol]
|
# @param :operation [Symbol]
|
||||||
# @param :dimensions [Hash]
|
# @param :dimensions [Hash]
|
||||||
# @param :beginning [Time]
|
# @param :beginning [Time]
|
||||||
# @return [Rollup]
|
# @return [Rollup]
|
||||||
def square_rollup(name:, new_name:, interval:, dimensions:, beginning:, operation: :sum)
|
def square_rollup(name:, new_name:, interval:, dimensions:, beginning:, operation: :sum)
|
||||||
Rollup.where(name: name, interval: interval_previous)
|
Rollup.where(name: name, interval: interval)
|
||||||
.where_dimensions(**dimensions)
|
.where_dimensions(**dimensions)
|
||||||
.where('time >= ?', beginning.try(:"beginning_of_#{interval}"))
|
.where('time >= ?', beginning.try(:"beginning_of_#{interval}"))
|
||||||
.group(*dimensions_to_jsonb_query(dimensions))
|
.group(*dimensions_to_jsonb_query(dimensions))
|
||||||
|
|
|
@ -52,11 +52,11 @@ class UriCollectionJob < PeriodicJob
|
||||||
columns.each do |column|
|
columns.each do |column|
|
||||||
# Obtener orígenes de visitas por host
|
# Obtener orígenes de visitas por host
|
||||||
AccessLog.where(**host_dimensions).distinct(column).pluck(column).each do |value|
|
AccessLog.where(**host_dimensions).distinct(column).pluck(column).each do |value|
|
||||||
name = "#{name}|#{column}"
|
column_name = "host|#{column}"
|
||||||
dimensions[column] = value
|
dimensions[column] = value
|
||||||
|
|
||||||
rollup(name, beginning, **dimensions)
|
rollup(column_name, beginning, **dimensions)
|
||||||
reduce_rollup(name, beginning, **dimensions)
|
reduce_rollup(column_name, beginning, **dimensions)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -145,6 +145,9 @@ class UriCollectionJob < PeriodicJob
|
||||||
|
|
||||||
# Recolecta todas las URIs menos imágenes
|
# Recolecta todas las URIs menos imágenes
|
||||||
#
|
#
|
||||||
|
# TODO: Para los sitios con DeployLocalizedDomain estamos buscando
|
||||||
|
# URIs de más.
|
||||||
|
#
|
||||||
# @return [Array]
|
# @return [Array]
|
||||||
def uris
|
def uris
|
||||||
@uris ||=
|
@uris ||=
|
||||||
|
|
Loading…
Reference in a new issue