mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-28 05:36:22 +00:00
Merge branch 'blazer' into panel.sutty.nl
This commit is contained in:
commit
062612eff8
1 changed files with 5 additions and 14 deletions
|
@ -33,39 +33,30 @@ class UriCollectionJob < PeriodicJob
|
|||
site.hostnames.each do |host|
|
||||
break if stop?
|
||||
|
||||
dimensions = { host: host }
|
||||
|
||||
uris.each do |uri|
|
||||
break if stop?
|
||||
|
||||
dimensions[:uri] = uri
|
||||
|
||||
rollup('host|uri', beginning, **dimensions)
|
||||
reduce_rollup('host|uri', beginning, **dimensions)
|
||||
rollup('host|uri', beginning, host: host, uri: uri)
|
||||
reduce_rollup('host|uri', beginning, host: host, uri: uri)
|
||||
end
|
||||
|
||||
dimensions.delete(:uri)
|
||||
|
||||
# Reducir todas las visitas a cantidad de visitas por host
|
||||
recursive_rollup(name: 'host|uri',
|
||||
new_name: 'host',
|
||||
interval_previous: starting_interval,
|
||||
interval: starting_interval,
|
||||
dimensions: dimensions,
|
||||
dimensions: { host: host },
|
||||
beginning: beginning)
|
||||
|
||||
# Acumular por mes y año
|
||||
reduce_rollup('host', beginning, **dimensions)
|
||||
reduce_rollup('host', beginning, host: host)
|
||||
|
||||
columns = %i[http_referer geoip2_data_country_name]
|
||||
columns.each do |column|
|
||||
# Obtener orígenes de visitas por host
|
||||
AccessLog.where(host: host).distinct(column).pluck(column).each do |value|
|
||||
dimensions.delete_if do |k, _|
|
||||
columns.include? k
|
||||
end
|
||||
|
||||
name = "host|#{column}"
|
||||
dimensions = { host: host }
|
||||
dimensions[column] = value
|
||||
|
||||
rollup(name, beginning, **dimensions)
|
||||
|
|
Loading…
Reference in a new issue