Skip to content

Commit

Permalink
Log slow command
Browse files Browse the repository at this point in the history
  • Loading branch information
neekolas committed Jun 26, 2024
1 parent 9cb3207 commit 6cac566
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions openmls/src/group/core_group/new_from_welcome.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,24 @@ impl StagedCoreWelcome {

/// Returns the [`LeafNode`] of the group member that authored the [`Welcome`] message.
pub fn welcome_sender(&self) -> Result<&LeafNode, LibraryError> {
let start_time = std::time::Instant::now();
let sender_index = self.welcome_sender_index();
self.public_group
log::info!(
"Getting to sender index took {}ms",
start_time.elapsed().as_millis()
);
let val = self
.public_group
.leaf(sender_index)
.ok_or(LibraryError::custom(
"no leaf with given welcome sender index exists",
))
));
log::info!(
"Getting to leaf node took {}ms",
start_time.elapsed().as_millis()
);

val
}

/// Consumes the [`StagedCoreWelcome`] and returns the respective [`CoreGroup`].
Expand Down

0 comments on commit 6cac566

Please sign in to comment.