-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Add a second argument to callbacks for grpc streams with metadata #3801
Add a second argument to callbacks for grpc streams with metadata #3801
Conversation
Hey @cchamplin,
Can you expand more on your use case? What kind of logic do you want to apply based on each single stream's request? Did you try to implement the measurement directly in your JavaScript code? The current proposed solution is very opinionated and specific for your case, it is worth exploring if we can do something a bit more generic. Metadata is a very specific concept in the gRPC ecosystem, did you pick |
@codebien We have a metric we are trying to capture that is essentially the around trip time it takes for certain events to arrive at a grpc client. At the moment we have not found a way to accurately capture this since we don't want to use a timestamp from the server and if we grab the data/time in the callback for the grpc stream message that may off by |
Hey, thanks for sharing. I thought a bit more about this and it makes sense. In the end, this is what we do with Response.timings on the HTTP module. Let me sync internally regarding the specific API, I would prefer if we have something consistent between modules and gRPC functions (both unary and streaming). |
Hey @cchamplin, the team synced on this pull request and we are fine with the current proposal. Please, can you rebase so we can merge it as-is? |
Hey @joanlopez, I won't be able to rebase this, can you take care of it, please? |
Change updates the grpc stream callbacks to all receivers to be passed a meta data object that includes the timestamp of the original event. This change facilitates being able to accurately check the time when a message was recevied by a client stream.
a474555
to
08a5066
Compare
@joanlopez I believe you also have some chats about the PR with codebien, so I'm positioning the final approve and merging this one with you |
@cchamplin, thanks for the contribution! |
What?
Change updates the grpc stream callbacks to all receivers to be passed a meta data object that includes the timestamp of the original event. This change facilitates being able to accurately check the time when a message was received by a client stream.
Why?
During during load testing it may be important to know exactly when specific messages are received by the client to track various heuristics. At the moment this is difficult or impossible to achieve because the callbacks are only executed when the vu's tick, so there may be a floor of the vu internal for all measured timestamps on messages unless the time the message was received is captured by the k6 runtime and passed into the vu.
Checklist
make lint
) and all checks pass.make tests
) and all tests pass.Related PR(s)/Issue(s)
No issue exists yet