From 604ee233bd1ef7bbbfa5ccd293a7d2edd6ca248e Mon Sep 17 00:00:00 2001 From: f Date: Sat, 30 Apr 2022 16:38:50 -0300 Subject: [PATCH] =?UTF-8?q?agregar=20la=20dimensi=C3=B3n=20al=20agrupar?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/jobs/uri_collection_job.rb | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) 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