mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-06-04 17:28:49 -04:00
Implement configurable stats reporting
SYN-287 This requires that HS owners either opt in or out of stats reporting. When --generate-config is passed, --report-stats must be specified If an already-generated config is used, and doesn't have the report_stats key, it is requested to be set.
This commit is contained in:
parent
ee2d722f0f
commit
7213588083
24 changed files with 425 additions and 78 deletions
|
@ -289,3 +289,15 @@ class RegistrationStore(SQLBaseStore):
|
|||
if ret:
|
||||
defer.returnValue(ret['user_id'])
|
||||
defer.returnValue(None)
|
||||
|
||||
@defer.inlineCallbacks
|
||||
def count_all_users(self):
|
||||
def _count_users(txn):
|
||||
txn.execute("SELECT COUNT(*) AS users FROM users")
|
||||
rows = self.cursor_to_dict(txn)
|
||||
if rows:
|
||||
return rows[0]["users"]
|
||||
return 0
|
||||
|
||||
ret = yield self.runInteraction("count_users", _count_users)
|
||||
defer.returnValue(ret)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue