-
Notifications
You must be signed in to change notification settings - Fork 196
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
Update messaging for measuring message delay between App and Hub #2499
Open
juanscr
wants to merge
11
commits into
main
Choose a base branch
from
juancard/messageDelay
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
maglims
reviewed
Sep 9, 2024
erinha
reviewed
Sep 9, 2024
juanscr
force-pushed
the
juancard/messageDelay
branch
2 times, most recently
from
September 11, 2024 00:41
61059e3
to
fe1cd61
Compare
sumathin-lang
requested changes
Sep 11, 2024
if (callbackInformation && message.timestamp) { | ||
handleHostToAppPerformanceMetrics({ | ||
actionName: callbackInformation.name, | ||
messageDelay: getCurrentTimestamp() - message.timestamp, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
from you local testing, can you please add some data points for values recorded both for two-way and one-way messages
sumathin-lang
requested changes
Sep 11, 2024
juanscr
force-pushed
the
juancard/messageDelay
branch
from
September 13, 2024 16:34
0ad25a2
to
114df12
Compare
juanscr
force-pushed
the
juancard/messageDelay
branch
from
September 23, 2024 14:05
7b23b3f
to
2c4236f
Compare
With this new timestamped messaged, the host can properly compare and evaluate how much time the request got delayed to an issue on a busy event loop.
This new handler will allow any application developer to register a function for analyzing or storing performance metrics related to latencies due to a message delay sending the response back from the host to the app.
The old field will be preserved with backwards compatibility with previous versions that still consume this field.
All the telemetry related code is added to the telemetry module to avoid cluttering the communication layer with nuances about telemetry.
juanscr
force-pushed
the
juancard/messageDelay
branch
2 times, most recently
from
October 9, 2024 20:53
28f9abb
to
3733b01
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This pull request has two purposes:
For the second purpose, with this PR, an app developer can register a function that receives the message delays per function call as soon as a response is received from the host so they can log it or store it in their own telemetry. As app developers do not have information about the internal message IDs, the handler gets passed information about the callback that is resolving so they can approximately pinpoint which call had that message delay.
Note: it was decided to not expose message IDs as it is a really big architectural change in the codebase and the value of exposing them to app developers would be really small in comparison to the change.
Main changes in the PR:
Date.now()
to useperformance.now() + performance.timeOrigin
.Validation
Validation performed:
Unit Tests added:
Yes
End-to-end tests added:
No
Additional Requirements
Change file added:
Yes
Next/remaining steps:
A following PR in the host SDK will be done in order to properly measure the App to Host message delay with the changes added in this pull request.