diff --git a/app/jobs/uri_collection_job.rb b/app/jobs/uri_collection_job.rb index 1553fb22..44642c1f 100644 --- a/app/jobs/uri_collection_job.rb +++ b/app/jobs/uri_collection_job.rb @@ -78,13 +78,18 @@ class UriCollectionJob < PeriodicJob reduce_rollup('host', beginning, :sum, **host_dimensions) columns.each_key do |column| - square_rollup(name: "host|uri|#{column}", - new_name: "host|#{column}", - interval: starting_interval, - dimensions: host_dimensions, - beginning: beginning) + values.each do |value| + column_dimensions = { host: host } + column_dimensions[column] = value - reduce_rollup("host|#{column}", beginning, :sum, **host_dimensions) + square_rollup(name: "host|uri|#{column}", + new_name: "host|#{column}", + interval: starting_interval, + dimensions: column_dimensions, + beginning: beginning) + + reduce_rollup("host|#{column}", beginning, :sum, **column_dimensions) + end end end