Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Matrix
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Container Registry
Model registry
Operate
Environments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TeDomum
Matrix
Commits
eebfd024
Unverified
Commit
eebfd024
authored
3 years ago
by
reivilibre
Committed by
GitHub
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Factorise `get_datastore` calls in phone_stats_home. (#10427)
Follow-up to #10332.
parent
4e340412
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
changelog.d/10427.feature
+1
-0
1 addition, 0 deletions
changelog.d/10427.feature
synapse/app/phone_stats_home.py
+18
-16
18 additions, 16 deletions
synapse/app/phone_stats_home.py
with
19 additions
and
16 deletions
changelog.d/10427.feature
0 → 100644
+
1
−
0
View file @
eebfd024
Add
a
new version of the R30 phone-home metric, which removes a false impression of retention given by the old R30 metric.
This diff is collapsed.
Click to expand it.
synapse/app/phone_stats_home.py
+
18
−
16
View file @
eebfd024
...
...
@@ -71,6 +71,8 @@ async def phone_stats_home(hs, stats, stats_process=_stats_process):
# General statistics
#
store
=
hs
.
get_datastore
()
stats
[
"
homeserver
"
]
=
hs
.
config
.
server_name
stats
[
"
server_context
"
]
=
hs
.
config
.
server_context
stats
[
"
timestamp
"
]
=
now
...
...
@@ -79,35 +81,35 @@ async def phone_stats_home(hs, stats, stats_process=_stats_process):
stats
[
"
python_version
"
]
=
"
{}.{}.{}
"
.
format
(
version
.
major
,
version
.
minor
,
version
.
micro
)
stats
[
"
total_users
"
]
=
await
hs
.
get_data
store
()
.
count_all_users
()
stats
[
"
total_users
"
]
=
await
store
.
count_all_users
()
total_nonbridged_users
=
await
hs
.
get_data
store
()
.
count_nonbridged_users
()
total_nonbridged_users
=
await
store
.
count_nonbridged_users
()
stats
[
"
total_nonbridged_users
"
]
=
total_nonbridged_users
daily_user_type_results
=
await
hs
.
get_data
store
()
.
count_daily_user_type
()
daily_user_type_results
=
await
store
.
count_daily_user_type
()
for
name
,
count
in
daily_user_type_results
.
items
():
stats
[
"
daily_user_type_
"
+
name
]
=
count
room_count
=
await
hs
.
get_data
store
()
.
get_room_count
()
room_count
=
await
store
.
get_room_count
()
stats
[
"
total_room_count
"
]
=
room_count
stats
[
"
daily_active_users
"
]
=
await
hs
.
get_data
store
()
.
count_daily_users
()
stats
[
"
monthly_active_users
"
]
=
await
hs
.
get_data
store
()
.
count_monthly_users
()
daily_active_e2ee_rooms
=
await
hs
.
get_data
store
()
.
count_daily_active_e2ee_rooms
()
stats
[
"
daily_active_users
"
]
=
await
store
.
count_daily_users
()
stats
[
"
monthly_active_users
"
]
=
await
store
.
count_monthly_users
()
daily_active_e2ee_rooms
=
await
store
.
count_daily_active_e2ee_rooms
()
stats
[
"
daily_active_e2ee_rooms
"
]
=
daily_active_e2ee_rooms
stats
[
"
daily_e2ee_messages
"
]
=
await
hs
.
get_data
store
()
.
count_daily_e2ee_messages
()
daily_sent_e2ee_messages
=
await
hs
.
get_data
store
()
.
count_daily_sent_e2ee_messages
()
stats
[
"
daily_e2ee_messages
"
]
=
await
store
.
count_daily_e2ee_messages
()
daily_sent_e2ee_messages
=
await
store
.
count_daily_sent_e2ee_messages
()
stats
[
"
daily_sent_e2ee_messages
"
]
=
daily_sent_e2ee_messages
stats
[
"
daily_active_rooms
"
]
=
await
hs
.
get_data
store
()
.
count_daily_active_rooms
()
stats
[
"
daily_messages
"
]
=
await
hs
.
get_data
store
()
.
count_daily_messages
()
daily_sent_messages
=
await
hs
.
get_data
store
()
.
count_daily_sent_messages
()
stats
[
"
daily_active_rooms
"
]
=
await
store
.
count_daily_active_rooms
()
stats
[
"
daily_messages
"
]
=
await
store
.
count_daily_messages
()
daily_sent_messages
=
await
store
.
count_daily_sent_messages
()
stats
[
"
daily_sent_messages
"
]
=
daily_sent_messages
r30_results
=
await
hs
.
get_data
store
()
.
count_r30_users
()
r30_results
=
await
store
.
count_r30_users
()
for
name
,
count
in
r30_results
.
items
():
stats
[
"
r30_users_
"
+
name
]
=
count
r30v2_results
=
await
hs
.
get_data
store
()
.
count_r30_users
()
r30v2_results
=
await
store
.
count_r30_users
()
for
name
,
count
in
r30v2_results
.
items
():
stats
[
"
r30v2_users_
"
+
name
]
=
count
...
...
@@ -119,8 +121,8 @@ async def phone_stats_home(hs, stats, stats_process=_stats_process):
#
# This only reports info about the *main* database.
stats
[
"
database_engine
"
]
=
hs
.
get_data
store
()
.
db_pool
.
engine
.
module
.
__name__
stats
[
"
database_server_version
"
]
=
hs
.
get_data
store
()
.
db_pool
.
engine
.
server_version
stats
[
"
database_engine
"
]
=
store
.
db_pool
.
engine
.
module
.
__name__
stats
[
"
database_server_version
"
]
=
store
.
db_pool
.
engine
.
server_version
#
# Logging configuration
...
...
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