-
Notifications
You must be signed in to change notification settings - Fork 70
Refactor node/edge iterator locking #2773
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
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
6852d0d
switch to lock per segment on node_entries
fabianmurariu b14a64e
rename entries and shout when graphql bench is broken in github
fabianmurariu 4bbe124
Merge remote-tracking branch 'origin/db_v4' into refactor_node_iter
fabianmurariu 966c189
only upload/show issues when graphql bench workflow fails
fabianmurariu 430100f
remove useless iterator
fabianmurariu d2963a1
remove extra logging add time for server to load
fabianmurariu 9ade639
fix some tests
fabianmurariu e4dd350
Trying to fix graphql-bench
fabianmurariu d568f01
clear git
fabianmurariu b60b1ba
Merge remote-tracking branch 'origin/db_v4' into refactor_node_iter
fabianmurariu ede5ac1
chore: apply tidy-public auto-fixes
github-actions[bot] 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
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
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
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
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
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 |
|---|---|---|
|
|
@@ -5,13 +5,44 @@ K6_IP=$(shell terraform output k6_ip | jq -r '.') | |
| RAPHTORY_IP=$(shell terraform output raphtory_ip | jq -r '.') | ||
|
|
||
|
|
||
| # Logs from the last run. Nothing in here reaches the terminal on a run that worked: the server | ||
| # and the bench are both noisy (tsc/tsup, the graph load, k6's own summary), and `--kill-others` | ||
| # means a server that dies takes k6 down with it, so what you want is the whole lot on disk and | ||
| # surfaced only when something breaks. process-k6-output.py prints them when it finds no results, | ||
| # and BENCH_VERBOSE=1 prints its report on a good run too. | ||
| # | ||
| # The k6 log is gzipped as it is written: a long run emits a lot of progress lines, and any | ||
| # request/response sampling that is switched on emits a whole JSON blob per sample, which reached | ||
| # 200MB uncompressed. Read it with `gzip -dc k6.log.gz | less` (or `| tail -n 100`). | ||
| BUILD_LOG ?= build.log | ||
| SERVER_LOG ?= server.log | ||
| K6_LOG ?= k6.log.gz | ||
|
|
||
| build: | ||
| pnpm install --frozen-lockfile | ||
| pnpm build | ||
| @{ pnpm install --no-frozen-lockfile && pnpm build ; } > $(BUILD_LOG) 2>&1 \ | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. shouldn't we keep the frozen, probably don't want to install random new versions of things... |
||
| || { echo ">>> build failed:"; cat $(BUILD_LOG); exit 1; } | ||
|
|
||
| # Purely informational, so nothing in here is allowed to fail. | ||
| bench-env: | ||
| @echo ">>> bench environment" | ||
| @k6 version || echo "k6 not on PATH" | ||
| @python -V || true | ||
| @python -c 'import pandas; print("pandas", pandas.__version__)' || echo "pandas not importable" | ||
| @echo ">>> graphs available to the server:" | ||
| @ls -la data/apache 2>&1 || true | ||
|
|
||
| bench-local: build | ||
| pnpm concurrently --raw --kill-others --names 'raphtory,bench' 'python server.py' 'sleep 10 && k6 run --out csv=output.csv.gz dist/bench.js' || : | ||
| python process-k6-output.py | ||
| @rm -f output.csv.gz output.json $(SERVER_LOG) $(K6_LOG) | ||
| @$(MAKE) --no-print-directory bench-env 2>&1 | gzip > $(K6_LOG) || true | ||
| @k6 version > /dev/null 2>&1 || echo ">>> WARNING: k6 is not on PATH" | ||
| @python -c 'import pandas' > /dev/null 2>&1 \ | ||
| || echo ">>> WARNING: pandas is not importable, results cannot be processed" | ||
| @echo ">>> running the bench; $(K6_LOG) and $(SERVER_LOG) have the details" | ||
| @pnpm concurrently --raw --kill-others --names 'raphtory,bench' \ | ||
| 'python -u server.py > $(SERVER_LOG) 2>&1' \ | ||
| '{ sh wait-for-server.sh && k6 run --out csv=output.csv.gz dist/bench.js ; } 2>&1 | gzip >> $(K6_LOG)' \ | ||
| ; echo ">>> concurrently exited with status $$?" | gzip >> $(K6_LOG) | ||
| @BENCH_SERVER_LOG=$(SERVER_LOG) BENCH_K6_LOG=$(K6_LOG) python process-k6-output.py | ||
|
|
||
| # call this like: make bench-e2-standard-16 | ||
| bench-%: | ||
|
|
@@ -25,6 +56,28 @@ bench: deploy push-graphs build-raphtory | |
| stress-test: build | ||
| K6_WEB_DASHBOARD=true K6_WEB_DASHBOARD_EXPORT=stress-test-report.html k6 run dist/stress-test.js | ||
|
|
||
| # Samples request/response pairs into $(SAMPLES) as JSONL (appends across runs). | ||
| # SAMPLE_RATE is the chance of recording any given pair; failures and requests slower than | ||
| # SLOW_MS are recorded whatever the rate, so `SAMPLE_RATE=0 make stress-test-sampled` keeps just | ||
| # those two. The slow ones are pretty printed into $(SLOW_LOG) when the run ends. | ||
| SAMPLES ?= samples.jsonl | ||
| SAMPLE_RATE ?= 0.01 | ||
| SLOW_MS ?= 1000 | ||
| SLOW_LOG ?= slow_req.log | ||
| stress-test-sampled: build | ||
| SAMPLE_RATE=$(SAMPLE_RATE) SLOW_MS=$(SLOW_MS) K6_WEB_DASHBOARD=true K6_WEB_DASHBOARD_EXPORT=stress-test-report.html \ | ||
| k6 run --log-format=raw --console-output=$(SAMPLES) dist/stress-test.js; \ | ||
| status=$$?; python slow_requests.py $(SAMPLES) --output $(SLOW_LOG); exit $$status | ||
|
|
||
| # Appends the slow requests from $(SAMPLES) to $(SLOW_LOG), slowest first: the query behind the | ||
| # max the summary reports, its variables, and whether the time went on the server (waiting) or | ||
| # somewhere between k6 and it. Entries already in the log are skipped, so this is safe to repeat. | ||
| # N limits how many are appended (0 = all), MIN_MS overrides the run's own SLOW_MS threshold. | ||
| N ?= 0 | ||
| MIN_MS ?= 0 | ||
| slowest: | ||
| python slow_requests.py $(SAMPLES) --output $(SLOW_LOG) --top $(N) --min-ms $(MIN_MS) | ||
|
|
||
| stress-test-multiple: build # 12 x 10m = 2h | ||
| for _ in $(seq 1 12); do \ | ||
| K6_WEB_DASHBOARD=true K6_WEB_DASHBOARD_EXPORT=stress-test-report.html k6 run --duration=10m dist/stress-test.js | ||
|
|
||
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.
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.
The type annotation shouldn't be needed...