about summary refs log tree commit diff
path: root/app/presenters
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2021-10-14 20:44:59 +0200
committerGitHub <noreply@github.com>2021-10-14 20:44:59 +0200
commit07341e7aa60fe7c7d4f298136af99276820940e7 (patch)
tree0244c21262573d6a94868f8ce7dfa934fabccf1e /app/presenters
parent959f7fc580050b37741c92b645b842e45017a010 (diff)
Add graphs and retention metrics to admin dashboard (#16829)
Diffstat (limited to 'app/presenters')
-rw-r--r--app/presenters/instance_presenter.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/presenters/instance_presenter.rb b/app/presenters/instance_presenter.rb
index 8cd774abe..3e85faa92 100644
--- a/app/presenters/instance_presenter.rb
+++ b/app/presenters/instance_presenter.rb
@@ -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