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

Add a GRPCClient that is re-usable by the same VU #10

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

aluu317
Copy link
Contributor

@aluu317 aluu317 commented Jun 9, 2022

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]

@kserve-oss-bot kserve-oss-bot requested a review from njhill June 9, 2022 22:25
@kserve-oss-bot
Copy link
Collaborator

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

import { Counter } from "k6/metrics";
import grpc from "k6/net/grpc";

const grpcReqs = new Counter("grpc_reqs");
Copy link
Member

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?

Copy link
Contributor Author

@aluu317 aluu317 Jun 10, 2022

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?

Copy link
Contributor Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants