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
64c2cfda
Commit
64c2cfda
authored
5 years ago
by
Erik Johnston
Browse files
Options
Downloads
Plain Diff
Merge branch 'release-v1.5.0' of github.com:matrix-org/synapse into develop
parents
a71b8c87
87259b3a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
changelog.d/6255.misc
+1
-0
1 addition, 0 deletions
changelog.d/6255.misc
synapse/handlers/stats.py
+3
-1
3 additions, 1 deletion
synapse/handlers/stats.py
tests/handlers/test_stats.py
+2
-0
2 additions, 0 deletions
tests/handlers/test_stats.py
with
6 additions
and
1 deletion
changelog.d/6255.misc
0 → 100644
+
1
−
0
View file @
64c2cfda
Small performance improvement by removing repeated config lookups in room stats calculation.
This diff is collapsed.
Click to expand it.
synapse/handlers/stats.py
+
3
−
1
View file @
64c2cfda
...
@@ -45,6 +45,8 @@ class StatsHandler(StateDeltasHandler):
...
@@ -45,6 +45,8 @@ class StatsHandler(StateDeltasHandler):
self
.
is_mine_id
=
hs
.
is_mine_id
self
.
is_mine_id
=
hs
.
is_mine_id
self
.
stats_bucket_size
=
hs
.
config
.
stats_bucket_size
self
.
stats_bucket_size
=
hs
.
config
.
stats_bucket_size
self
.
stats_enabled
=
hs
.
config
.
stats_enabled
# The current position in the current_state_delta stream
# The current position in the current_state_delta stream
self
.
pos
=
None
self
.
pos
=
None
...
@@ -61,7 +63,7 @@ class StatsHandler(StateDeltasHandler):
...
@@ -61,7 +63,7 @@ class StatsHandler(StateDeltasHandler):
def
notify_new_event
(
self
):
def
notify_new_event
(
self
):
"""
Called when there may be more deltas to process
"""
Called when there may be more deltas to process
"""
"""
if
not
self
.
hs
.
config
.
stats_enabled
or
self
.
_is_processing
:
if
not
self
.
stats_enabled
or
self
.
_is_processing
:
return
return
self
.
_is_processing
=
True
self
.
_is_processing
=
True
...
...
This diff is collapsed.
Click to expand it.
tests/handlers/test_stats.py
+
2
−
0
View file @
64c2cfda
...
@@ -607,6 +607,7 @@ class StatsRoomTests(unittest.HomeserverTestCase):
...
@@ -607,6 +607,7 @@ class StatsRoomTests(unittest.HomeserverTestCase):
"""
"""
self
.
hs
.
config
.
stats_enabled
=
False
self
.
hs
.
config
.
stats_enabled
=
False
self
.
handler
.
stats_enabled
=
False
u1
=
self
.
register_user
(
"
u1
"
,
"
pass
"
)
u1
=
self
.
register_user
(
"
u1
"
,
"
pass
"
)
u1token
=
self
.
login
(
"
u1
"
,
"
pass
"
)
u1token
=
self
.
login
(
"
u1
"
,
"
pass
"
)
...
@@ -618,6 +619,7 @@ class StatsRoomTests(unittest.HomeserverTestCase):
...
@@ -618,6 +619,7 @@ class StatsRoomTests(unittest.HomeserverTestCase):
self
.
assertIsNone
(
self
.
_get_current_stats
(
"
user
"
,
u1
))
self
.
assertIsNone
(
self
.
_get_current_stats
(
"
user
"
,
u1
))
self
.
hs
.
config
.
stats_enabled
=
True
self
.
hs
.
config
.
stats_enabled
=
True
self
.
handler
.
stats_enabled
=
True
self
.
_perform_background_initial_update
()
self
.
_perform_background_initial_update
()
...
...
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