mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-16 21:46:22 +00:00
las tablas también están filtradas
This commit is contained in:
parent
158c224449
commit
3f29d87acd
1 changed files with 11 additions and 11 deletions
|
@ -46,17 +46,17 @@ class StatsController < ApplicationController
|
|||
Stat::COLUMNS.each do |column|
|
||||
@columns[column] =
|
||||
Rails.cache.fetch("stats/#{column}/#{site.id}", expires_in: expires_in) do
|
||||
Rollup.where(interval: interval, name: "host|#{column}")
|
||||
.where_dimensions(host: hostnames)
|
||||
.group("dimensions->>'#{column}'")
|
||||
.sum(:value)
|
||||
.transform_values(&:to_i)
|
||||
.transform_values do |v|
|
||||
v * nodes
|
||||
end
|
||||
.sort_by do |_, v|
|
||||
v
|
||||
end.reverse.to_h
|
||||
rollup_scope.where(interval: interval, name: "host|#{column}")
|
||||
.where_dimensions(host: hostnames)
|
||||
.group("dimensions->>'#{column}'")
|
||||
.sum(:value)
|
||||
.transform_values(&:to_i)
|
||||
.transform_values do |v|
|
||||
v * nodes
|
||||
end
|
||||
.sort_by do |_, v|
|
||||
v
|
||||
end.reverse.to_h
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue