summary refs log tree commit diff
path: root/synapse/crypto
diff options
context:
space:
mode:
authorEric Eastwood <erice@element.io>2022-08-23 21:53:37 -0500
committerGitHub <noreply@github.com>2022-08-23 21:53:37 -0500
commit7af07f9716e6b4a2238ecd435e19bf8501360bc7 (patch)
tree51a6cbc3f80c0937f7c2c473bde7f5fde11d2b4c /synapse/crypto
parentWrite about the chain cover a little. (#13602) (diff)
downloadsynapse-7af07f9716e6b4a2238ecd435e19bf8501360bc7.tar.xz
Instrument `_check_sigs_and_hash_and_fetch` to trace time spent in child concurrent calls (#13588)
Instrument `_check_sigs_and_hash_and_fetch` to trace time spent in child concurrent calls because I've see `_check_sigs_and_hash_and_fetch` take [10.41s to process 100 events](https://github.com/matrix-org/synapse/issues/13587)

Fix https://github.com/matrix-org/synapse/issues/13587

Part of https://github.com/matrix-org/synapse/issues/13356
Diffstat (limited to 'synapse/crypto')
-rw-r--r--synapse/crypto/event_signing.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/synapse/crypto/event_signing.py b/synapse/crypto/event_signing.py
index 7520647d1e..23b799ac32 100644
--- a/synapse/crypto/event_signing.py
+++ b/synapse/crypto/event_signing.py
@@ -28,6 +28,7 @@ from synapse.api.errors import Codes, SynapseError
 from synapse.api.room_versions import RoomVersion
 from synapse.events import EventBase
 from synapse.events.utils import prune_event, prune_event_dict
+from synapse.logging.opentracing import trace
 from synapse.types import JsonDict
 
 logger = logging.getLogger(__name__)
@@ -35,6 +36,7 @@ logger = logging.getLogger(__name__)
 Hasher = Callable[[bytes], "hashlib._Hash"]
 
 
+@trace
 def check_event_content_hash(
     event: EventBase, hash_algorithm: Hasher = hashlib.sha256
 ) -> bool: