Add graphs and retention metrics to admin dashboard (#16829)
This commit is contained in:
parent
959f7fc580
commit
07341e7aa6
46 changed files with 1650 additions and 257 deletions
|
@ -24,8 +24,8 @@ class InstancePresenter
|
|||
Rails.cache.fetch('user_count') { User.confirmed.joins(:account).merge(Account.without_suspended).count }
|
||||
end
|
||||
|
||||
def active_user_count(weeks = 4)
|
||||
Rails.cache.fetch("active_user_count/#{weeks}") { Redis.current.pfcount(*(0...weeks).map { |i| "activity:logins:#{i.weeks.ago.utc.to_date.cweek}" }) }
|
||||
def active_user_count(num_weeks = 4)
|
||||
Rails.cache.fetch("active_user_count/#{num_weeks}") { ActivityTracker.new('activity:logins', :unique).sum(num_weeks.weeks.ago) }
|
||||
end
|
||||
|
||||
def status_count
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue