diff options
author | Neil Johnson <neil@matrix.org> | 2018-08-08 12:44:15 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-08 12:44:15 +0000 |
commit | 990fe9fc23245d193233b88f924e905ee4b2de3d (patch) | |
tree | bc5aed8a97fdd22845ec48e5c84fea981f812003 /synapse/app | |
parent | Merge pull request #3658 from matrix-org/rav/fix_event_persisted_position_met... (diff) | |
parent | typos (diff) | |
download | synapse-990fe9fc23245d193233b88f924e905ee4b2de3d.tar.xz |
Merge pull request #3633 from matrix-org/neilj/mau_tracker
API for monthly_active_users table
Diffstat (limited to 'synapse/app')
-rwxr-xr-x | synapse/app/homeserver.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/synapse/app/homeserver.py b/synapse/app/homeserver.py index fba51c26e8..3a67db8b30 100755 --- a/synapse/app/homeserver.py +++ b/synapse/app/homeserver.py @@ -518,12 +518,15 @@ def run(hs): # If you increase the loop period, the accuracy of user_daily_visits # table will decrease clock.looping_call(generate_user_daily_visit_stats, 5 * 60 * 1000) + clock.looping_call( + hs.get_datastore().reap_monthly_active_users, 1000 * 60 * 60 + ) @defer.inlineCallbacks def generate_monthly_active_users(): count = 0 if hs.config.limit_usage_by_mau: - count = yield hs.get_datastore().count_monthly_users() + count = yield hs.get_datastore().get_monthly_active_count() current_mau_gauge.set(float(count)) max_mau_value_gauge.set(float(hs.config.max_mau_value)) |