From e35fa8746436fdd62caa3b10c3314a4de8cd260d Mon Sep 17 00:00:00 2001 From: f Date: Tue, 18 Jun 2024 10:45:57 -0300 Subject: [PATCH 1/2] fix: ya no es necesario estimar visitas #16542 --- app/controllers/stats_controller.rb | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/app/controllers/stats_controller.rb b/app/controllers/stats_controller.rb index c2c7bc58..bc5bb962 100644 --- a/app/controllers/stats_controller.rb +++ b/app/controllers/stats_controller.rb @@ -59,9 +59,6 @@ class StatsController < ApplicationController .order('sum(value) desc') .sum(:value) .transform_values(&:to_i) - .transform_values do |v| - v * nodes - end end end end @@ -73,9 +70,6 @@ class StatsController < ApplicationController stats = rollup_scope.where_dimensions(host: hostnames).multi_series('host', interval: interval).tap do |series| series.each do |serie| serie[:name] = serie.dig(:dimensions, 'host') - serie[:data].transform_values! do |value| - value * nodes - end end end @@ -99,9 +93,6 @@ class StatsController < ApplicationController stats = rollup_scope.where_dimensions(**options).multi_series('host|uri', interval: interval).tap do |series| series.each do |serie| serie[:name] = serie[:dimensions].slice('host', 'uri').values.join.sub('/index.html', '/') - serie[:data].transform_values! do |value| - value * nodes - end end end @@ -197,21 +188,6 @@ class StatsController < ApplicationController end end - # Obtiene la cantidad de nodos de Sutty, para poder calcular la - # cantidad de visitas. - # - # Como repartimos las visitas por nodo rotando las IPs en el - # nameserver y los resolvedores de DNS eligen un nameserver - # aleatoriamente, la cantidad de visitas se reparte - # equitativamente. - # - # XXX: Remover cuando podamos centralizar los AccessLog - # - # @return [Integer] - def nodes - @nodes ||= ENV.fetch('NODES', 1).to_i - end - def period @period ||= begin p = params.permit(:period_start, :period_end) From 11e2353c2fdebcbddb7a18ad02342852cd84ba11 Mon Sep 17 00:00:00 2001 From: fauno Date: Tue, 18 Jun 2024 15:14:57 +0000 Subject: [PATCH 2/2] ci: test [skip ci]