Skip to content

Commit 610ecd2

Browse files
committed
feat(sdk): Log the time spent waiting on the position lock.
1 parent fa300d1 commit 610ecd2

File tree

1 file changed

+5
-1
lines changed
  • crates/matrix-sdk/src/sliding_sync

1 file changed

+5
-1
lines changed

crates/matrix-sdk/src/sliding_sync/mod.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,11 @@ impl SlidingSync {
399399
// has been fully handled successfully, in this case the `pos` is updated, or
400400
// the response handling has failed, in this case the `pos` hasn't been updated
401401
// and the same `pos` will be used for this new request.
402-
let mut position_guard = self.inner.position.clone().lock_owned().await;
402+
let mut position_guard = {
403+
let _timer = timer!("acquiring the `position` lock");
404+
405+
self.inner.position.clone().lock_owned().await
406+
};
403407

404408
let to_device_enabled =
405409
self.inner.sticky.read().unwrap().data().extensions.to_device.enabled == Some(true);

0 commit comments

Comments
 (0)