-
Notifications
You must be signed in to change notification settings - Fork 69
feat/gateway: Add src gateway benchmark
command
#1124
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
Conversation
Cool, great starting point! can you get this client talking to / benchmarking 4 endpoints? e.g. with one test
i.e. if the user passes Then the default if you pass nothing can be to run against Cody Gateway prod and Sourcegraph.com For (2) and (4) you'll need to add a websocket client to this PR, you should be able to do that testing against any websocket server until I have a chance to debug the issue you brought up with doing it in the SG instance. |
src gateway benchmark
command
Update: In response to the main message:
It's like 20 min to add these but I haven't had the time. Later. |
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.
Cool, this looks good, I'm going to merge as-is and we can continue iterating in main
together
Adds the
src gateway benchmark
command to the tool.https://github.com/sourcegraph/sourcegraph/pull/1526 adds some new endpoints that this benchmarking script uses.
The benchmarking tool compares
threetwo routes using the endpoints added in above PR:Testing the benchmarking tool locally
(Description WIP)
brew install ngrok/ngrok/ngrok
if you don't have ngrokngrok http http://localhost:9992
*.ngrok-free.app
URL from the "Forwarding" section of ngrok's output to yourdev-private/enterprise/dev/site-config.json
as the "modelConfiguration" / "sourcegraph" / "endpoint" value.wss://
, notws://
! (Just a one-char change but it's manual for now.) But when running locally, it needs to bews://
. Something to be mindful of when running this and in the future.run sg dotcom
src gateway benchmark
The output should look like this:
Next steps
Missing work to be done:
{codyGatewayUrl}/v2/http
and{codyGatewayUrl}/v2/websocket
.Test plan
Tested manually:
go run ./cmd/src
lists the newgateway
command correctly.go run ./cmd/src gateway
lists thebenchmark
subcommand correctly.go run ./cmd/src gateway benchmark
runs the benchmarks against the endpoint set in theSRC_ENDPOINT
env var correctly.go run ./cmd/src gateway benchmark --requests 2
sets the number of requests correctly.SRC_ENDPOINT=http://localhost:3080 go run ./cmd/src gateway benchmark --requests 2
sets the endpoint to my localhost and works correctly.