Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
synapse
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Maunium
synapse
Commits
4b461a69
Commit
4b461a69
authored
7 years ago
by
Erik Johnston
Browse files
Options
Downloads
Patches
Plain Diff
Add some more stats
parent
93e7a383
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
synapse/app/homeserver.py
+7
-0
7 additions, 0 deletions
synapse/app/homeserver.py
synapse/storage/events.py
+15
-0
15 additions, 0 deletions
synapse/storage/events.py
synapse/storage/registration.py
+13
-0
13 additions, 0 deletions
synapse/storage/registration.py
with
35 additions
and
0 deletions
synapse/app/homeserver.py
+
7
−
0
View file @
4b461a69
...
...
@@ -415,8 +415,15 @@ def run(hs):
stats
[
"
timestamp
"
]
=
now
stats
[
"
uptime_seconds
"
]
=
uptime
stats
[
"
total_users
"
]
=
yield
hs
.
get_datastore
().
count_all_users
()
stats
[
"
total_users
"
]
=
yield
hs
.
get_datastore
().
count_nonbridged_users
()
room_count
=
yield
hs
.
get_datastore
().
get_room_count
()
stats
[
"
total_room_count
"
]
=
room_count
stats
[
"
daily_active_users
"
]
=
yield
hs
.
get_datastore
().
count_daily_users
()
stats
[
"
daily_active_rooms
"
]
=
yield
hs
.
get_datastore
().
count_daily_active_rooms
()
stats
[
"
daily_messages
"
]
=
yield
hs
.
get_datastore
().
count_daily_messages
()
daily_sent_messages
=
yield
hs
.
get_datastore
().
count_daily_sent_messages
()
stats
[
"
daily_sent_messages
"
]
=
daily_sent_messages
...
...
This diff is collapsed.
Click to expand it.
synapse/storage/events.py
+
15
−
0
View file @
4b461a69
...
...
@@ -1631,6 +1631,21 @@ class EventsStore(SQLBaseStore):
ret
=
yield
self
.
runInteraction
(
"
count_daily_sent_messages
"
,
_count_messages
)
defer
.
returnValue
(
ret
)
@defer.inlineCallbacks
def
count_daily_active_rooms
(
self
):
def
_count
(
txn
):
sql
=
"""
SELECT COALESCE(COUNT(DISTINCT room_id), 0) FROM events
WHERE type =
'
m.room.message
'
AND stream_ordering > ?
"""
txn
.
execute
(
sql
,
(
self
.
stream_ordering_day_ago
,))
count
,
=
txn
.
fetchone
()
return
count
ret
=
yield
self
.
runInteraction
(
"
count_daily_active_rooms
"
,
_count
)
defer
.
returnValue
(
ret
)
@defer.inlineCallbacks
def
_background_reindex_fields_sender
(
self
,
progress
,
batch_size
):
target_min_stream_id
=
progress
[
"
target_min_stream_id_inclusive
"
]
...
...
This diff is collapsed.
Click to expand it.
synapse/storage/registration.py
+
13
−
0
View file @
4b461a69
...
...
@@ -437,6 +437,19 @@ class RegistrationStore(background_updates.BackgroundUpdateStore):
ret
=
yield
self
.
runInteraction
(
"
count_users
"
,
_count_users
)
defer
.
returnValue
(
ret
)
@defer.inlineCallbacks
def
count_nonbridged_users
(
self
):
def
_count_users
(
txn
):
txn
.
execute
(
"""
SELECT COALESCE(COUNT(*), 0) FROM users
WHERE appservice_id IS NULL
"""
)
count
,
=
txn
.
fetchone
()
return
count
ret
=
yield
self
.
runInteraction
(
"
count_users
"
,
_count_users
)
defer
.
returnValue
(
ret
)
@defer.inlineCallbacks
def
find_next_generated_user_id_localpart
(
self
):
"""
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment