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
a5d93032
Commit
a5d93032
authored
8 years ago
by
Erik Johnston
Committed by
GitHub
8 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #1878 from matrix-org/erikj/device_measure
Measure new device list stuff
parents
8da976fe
a597994f
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
synapse/handlers/device.py
+4
-0
4 additions, 0 deletions
synapse/handlers/device.py
synapse/handlers/sync.py
+2
-1
2 additions, 1 deletion
synapse/handlers/sync.py
with
6 additions
and
1 deletion
synapse/handlers/device.py
+
4
−
0
View file @
a5d93032
...
@@ -17,6 +17,7 @@ from synapse.api import errors
...
@@ -17,6 +17,7 @@ from synapse.api import errors
from
synapse.api.constants
import
EventTypes
from
synapse.api.constants
import
EventTypes
from
synapse.util
import
stringutils
from
synapse.util
import
stringutils
from
synapse.util.async
import
Linearizer
from
synapse.util.async
import
Linearizer
from
synapse.util.metrics
import
measure_func
from
synapse.types
import
get_domain_from_id
,
RoomStreamToken
from
synapse.types
import
get_domain_from_id
,
RoomStreamToken
from
twisted.internet
import
defer
from
twisted.internet
import
defer
from
._base
import
BaseHandler
from
._base
import
BaseHandler
...
@@ -193,6 +194,7 @@ class DeviceHandler(BaseHandler):
...
@@ -193,6 +194,7 @@ class DeviceHandler(BaseHandler):
else
:
else
:
raise
raise
@measure_func
(
"
notify_device_update
"
)
@defer.inlineCallbacks
@defer.inlineCallbacks
def
notify_device_update
(
self
,
user_id
,
device_ids
):
def
notify_device_update
(
self
,
user_id
,
device_ids
):
"""
Notify that a user
'
s device(s) has changed. Pokes the notifier, and
"""
Notify that a user
'
s device(s) has changed. Pokes the notifier, and
...
@@ -223,6 +225,7 @@ class DeviceHandler(BaseHandler):
...
@@ -223,6 +225,7 @@ class DeviceHandler(BaseHandler):
for
host
in
hosts
:
for
host
in
hosts
:
self
.
federation_sender
.
send_device_messages
(
host
)
self
.
federation_sender
.
send_device_messages
(
host
)
@measure_func
(
"
device.get_user_ids_changed
"
)
@defer.inlineCallbacks
@defer.inlineCallbacks
def
get_user_ids_changed
(
self
,
user_id
,
from_token
):
def
get_user_ids_changed
(
self
,
user_id
,
from_token
):
"""
Get list of users that have had the devices updated, or have newly
"""
Get list of users that have had the devices updated, or have newly
...
@@ -276,6 +279,7 @@ class DeviceHandler(BaseHandler):
...
@@ -276,6 +279,7 @@ class DeviceHandler(BaseHandler):
# and those that actually still share a room with the user
# and those that actually still share a room with the user
defer
.
returnValue
(
users_who_share_room
&
possibly_changed
)
defer
.
returnValue
(
users_who_share_room
&
possibly_changed
)
@measure_func
(
"
_incoming_device_list_update
"
)
@defer.inlineCallbacks
@defer.inlineCallbacks
def
_incoming_device_list_update
(
self
,
origin
,
edu_content
):
def
_incoming_device_list_update
(
self
,
origin
,
edu_content
):
user_id
=
edu_content
[
"
user_id
"
]
user_id
=
edu_content
[
"
user_id
"
]
...
...
This diff is collapsed.
Click to expand it.
synapse/handlers/sync.py
+
2
−
1
View file @
a5d93032
...
@@ -16,7 +16,7 @@
...
@@ -16,7 +16,7 @@
from
synapse.api.constants
import
Membership
,
EventTypes
from
synapse.api.constants
import
Membership
,
EventTypes
from
synapse.util.async
import
concurrently_execute
from
synapse.util.async
import
concurrently_execute
from
synapse.util.logcontext
import
LoggingContext
from
synapse.util.logcontext
import
LoggingContext
from
synapse.util.metrics
import
Measure
from
synapse.util.metrics
import
Measure
,
measure_func
from
synapse.util.caches.response_cache
import
ResponseCache
from
synapse.util.caches.response_cache
import
ResponseCache
from
synapse.push.clientformat
import
format_push_rules_for_user
from
synapse.push.clientformat
import
format_push_rules_for_user
from
synapse.visibility
import
filter_events_for_client
from
synapse.visibility
import
filter_events_for_client
...
@@ -561,6 +561,7 @@ class SyncHandler(object):
...
@@ -561,6 +561,7 @@ class SyncHandler(object):
next_batch
=
sync_result_builder
.
now_token
,
next_batch
=
sync_result_builder
.
now_token
,
))
))
@measure_func
(
"
_generate_sync_entry_for_device_list
"
)
@defer.inlineCallbacks
@defer.inlineCallbacks
def
_generate_sync_entry_for_device_list
(
self
,
sync_result_builder
):
def
_generate_sync_entry_for_device_list
(
self
,
sync_result_builder
):
user_id
=
sync_result_builder
.
sync_config
.
user
.
to_string
()
user_id
=
sync_result_builder
.
sync_config
.
user
.
to_string
()
...
...
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