mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
Remove users column from Top Traffic Sources table on dashboard. It's not useful and very expensive to calculate.
This commit is contained in:
@@ -63,10 +63,9 @@ class IncomingLinksReport
|
||||
|
||||
num_clicks = link_count_per_domain
|
||||
num_topics = topic_count_per_domain(num_clicks.keys)
|
||||
num_users = user_count_per_domain(num_clicks.keys)
|
||||
report.data = []
|
||||
num_clicks.keys.each do |domain|
|
||||
report.data << {domain: domain, num_clicks: num_clicks[domain], num_topics: num_topics[domain], num_users: num_users[domain]}
|
||||
report.data << {domain: domain, num_clicks: num_clicks[domain], num_topics: num_topics[domain]}
|
||||
end
|
||||
report.data = report.data.sort_by {|x| x[:num_clicks]}.reverse[0,10]
|
||||
end
|
||||
@@ -84,11 +83,6 @@ class IncomingLinksReport
|
||||
per_domain(domains).count('topic_id', distinct: true)
|
||||
end
|
||||
|
||||
def self.user_count_per_domain(domains)
|
||||
# COUNT(DISTINCT) is slow
|
||||
per_domain(domains).count('user_id', distinct: true)
|
||||
end
|
||||
|
||||
|
||||
def self.report_top_referred_topics(report)
|
||||
report.y_titles[:num_clicks] = I18n.t("reports.#{report.type}.num_clicks")
|
||||
|
||||
Reference in New Issue
Block a user