-
Notifications
You must be signed in to change notification settings - Fork 9
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 GRPCClient that is re-usable by the same VU #10
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Angel Luu <[email protected]>
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: aluu317 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Signed-off-by: Angel Luu <[email protected]>
Signed-off-by: Angel Luu <[email protected]>
import { Counter } from "k6/metrics"; | ||
import grpc from "k6/net/grpc"; | ||
|
||
const grpcReqs = new Counter("grpc_reqs"); |
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.
@aluu317 do you know why this is needed? I thought k6 already counts the requests itself?
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.
I copied this from the MLServer benchmark test. I actually was not able to see how the counter grpcReqs
was used in the ML Server example. I assume it maybe for logging/tracking purposes which we can certainly log in our k6 test?
Do you think it maybe useful to know how many GRPC infer requests each VU actually makes and log it out?
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.
but to answer your question, yes, k6 logs it, something like this:
✗ status is OK
↳ 0% — ✓ 0 / ✗ 272
█ setup
✗ status is OK
↳ 0% — ✓ 0 / ✗ 1
█ teardown
checks...............: 0.00% ✓ 0 ✗ 273
So 273 is total checks, but unsure how many for each VU
Inspo from MLServer benchmark GRPC Client.
This is to make sure each VU or thread can re-use the same GRPC connection for the entirety of testing. Not re connect every test.
With this change, when each test is run, each VU should open 1 connection. So if the test has 5 vus, if you run a port-forward, you should see 5 "Handling connection..." logs and only 5.
Signed-off-by: Angel Luu [email protected]