diff options
author | Neil Johnson <neil@matrix.org> | 2018-09-12 17:14:04 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-12 17:14:04 +0100 |
commit | f30a30359074647de6e000ac9eb70e6bc84d9df8 (patch) | |
tree | 3689904805e4d57a75184d197c97ef44ef9d7e60 /synapse/app | |
parent | show heroes if a room has a 'deleted' name/canonical_alias (#3851) (diff) | |
parent | improve naming (diff) | |
download | synapse-f30a30359074647de6e000ac9eb70e6bc84d9df8.tar.xz |
Merge pull request #3846 from matrix-org/neilj/expose-registered-users hhs-7
expose number of real reserved users
Diffstat (limited to 'synapse/app')
-rwxr-xr-x | synapse/app/homeserver.py | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/synapse/app/homeserver.py b/synapse/app/homeserver.py index 3eb5b663de..ac97e19649 100755 --- a/synapse/app/homeserver.py +++ b/synapse/app/homeserver.py @@ -307,6 +307,10 @@ class SynapseHomeServer(HomeServer): # Gauges to expose monthly active user control metrics current_mau_gauge = Gauge("synapse_admin_mau:current", "Current MAU") max_mau_gauge = Gauge("synapse_admin_mau:max", "MAU Limit") +registered_reserved_users_mau_gauge = Gauge( + "synapse_admin_mau:registered_reserved_users", + "Registered users with reserved threepids" +) def setup(config_options): @@ -531,10 +535,14 @@ def run(hs): @defer.inlineCallbacks def generate_monthly_active_users(): - count = 0 + current_mau_count = 0 + reserved_count = 0 + store = hs.get_datastore() if hs.config.limit_usage_by_mau: - count = yield hs.get_datastore().get_monthly_active_count() - current_mau_gauge.set(float(count)) + current_mau_count = yield store.get_monthly_active_count() + reserved_count = yield store.get_registered_reserved_users_count() + current_mau_gauge.set(float(current_mau_count)) + registered_reserved_users_mau_gauge.set(float(reserved_count)) max_mau_gauge.set(float(hs.config.max_mau_value)) hs.get_datastore().initialise_reserved_users( |