Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Track timing #175

Open
fregante opened this issue Nov 10, 2023 · 2 comments
Open

Track timing #175

fregante opened this issue Nov 10, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@fregante
Copy link
Collaborator

We can add meta-data to the message itself to track the time in messenger vs. handler (with send/receipt/etc. timestamps before delegating to the handler

@fregante
Copy link
Collaborator Author

cc @BLoe thoughts?

I think this information can generate further warning logs or events when context crossing takes a while.

log.debug(type, seq, "↘️ received in", getContextName(), {
  sender,
  args,
  wasForwarded: trace.length > 1,
});

if (tooLong) {
	log.warn(type, seq, "↘️ crossed context in", duration);
}

By "context crossing time" I mean:

  • the time between a successful runtime.sendMessage and runtime.onMessage callback to be called
  • the time between return and the resolution of the last runtime.sendMessage() Promise

This excludes handler execution time and retries, which are not relevant and already visible respectively.

@BLoe
Copy link

BLoe commented Nov 15, 2023

Yes, I think it does make sense to log when a specific message takes a long time in this case

@fregante fregante removed their assignment Jan 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

No branches or pull requests

2 participants