-
Notifications
You must be signed in to change notification settings - Fork 0
Benchmarks v2 #60
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
Merged
Merged
Benchmarks v2 #60
Changes from 5 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
a72f693
add benchmarks2
podocarp 360725d
add some env vars
podocarp b268dca
add script to run all benchmarks
podocarp a2e612b
add uv to nix and direnv, run auto format
podocarp 061c2d4
add benchmarks.md
podocarp 5303c82
fix benchmarks readme
podocarp cf2f881
fix type warnings
podocarp File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| use flake | ||
| [ -d .venv ] || uv venv | ||
| source_env .venv/bin/activate |
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| # Benchmarking guide for Tusk Drift Python SDK | ||
|
|
||
| ## Overview | ||
|
|
||
| The benchmarking methodology is the same across all our SDKs. | ||
| It piggy backs off the end to end tests, so that test cases are automatically | ||
| discovered, and we don't have to setup multiple apps in multiple different | ||
| places to run tests. | ||
|
|
||
| The simplest way to get started it simply | ||
| ``` | ||
| ./run-all-e2e-tests.sh | ||
| ``` | ||
| or to run a single (or a few) instrumentations, | ||
| ``` | ||
| ./run-all-benchmarks.sh -f flask,fastapi | ||
| ``` | ||
|
|
||
| Within each instrumentation's e2e tests, you can also run it as such | ||
| ``` | ||
| BENCHMARKS=1 ./drift/instrumentation/aiohttp/e2e-tests/run.sh | ||
| ``` | ||
| but it is not as convenient. The run-all script is essentially just automating | ||
| this for you (there's some other settings it sets automatically) | ||
|
|
||
| ## Methodology | ||
|
|
||
| Benchmarks are run with a (by default) 3 second warm up, and 10 seconds of | ||
| actual measurement. This is very important especially for tests that make http | ||
| or filesystem queries, since the warm up also warms up all system caches (think | ||
| ARP, DNS, buffers, etc.). Disabling warm up *will* produce nonsensical results. | ||
|
|
||
| The benchmarking process itself is simple. We start the app exactly as how the | ||
| e2e tests would, but the make_request helper function used by the e2e tests have | ||
| been hijacked to run continuously instead of returning after a single call. | ||
| We then measure the ops/second achieved during our 10s test interval, and print | ||
| out the results. We do this first for the SDK disabled case, and then again for | ||
| the SDK enabled case. The SDK is enabled/disabled through the standard | ||
| `TUSK_DRIFT_MODE` envvar. | ||
|
|
||
| ## Implementing benchmarks | ||
|
|
||
| If you've read through the above you will realise adding benchmarks is really | ||
| easy! | ||
| Simply add a new endpoint to an existing e2e test, or add a new e2e test | ||
| entirely in the same format -- the run-all script auto discovers based on the | ||
| run.sh script in each e2e test folder. | ||
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.