-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Run flamegraph reporting in Github CI
- Loading branch information
1 parent
52da6ca
commit 4b9b05a
Showing
2 changed files
with
60 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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,26 @@ | ||
#!/bin/bash | ||
|
||
account=0x33c6b73432B3aeA0C1725E415CC40D04908B85fd | ||
end_val=$((172 * 1000 * 10000000)) | ||
|
||
cd ../../ | ||
|
||
echo "Running ethrex..." | ||
CARGO_PROFILE_RELEASE_DEBUG=true cargo flamegraph --bin ethrex --features dev -- --network test_data/genesis-l2.json --http.port 1729 & | ||
echo "Sleeping 10s before running test..." | ||
sleep 10 | ||
echo "Sending to account $account" | ||
ethrex_l2 test load --path ./test_data/private_keys.txt -i 1000 -v --value 10000000 --to $account | ||
|
||
echo "Monitoring..." | ||
output=$(cast balance $account --rpc-url=http://localhost:1729 2>&1) | ||
echo "ini $output" | ||
echo "end $end_val" | ||
while [[ $output -le $end_val ]]; do | ||
sleep 5 | ||
output=$(cast balance $account --rpc-url=http://localhost:1729 2>&1) | ||
echo "out $output" | ||
done | ||
echo "Balance of $output reached, killing process ethrex" | ||
|
||
sudo pkill ethrex && while pgrep -l cargo flamegraph; do sleep 1;done; |
This file contains 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,34 @@ | ||
name: Daily Flamegraph Reporter | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "**" ] | ||
workflow_dispatch: | ||
|
||
env: | ||
RUST_VERSION: 1.81.0 | ||
|
||
jobs: | ||
flamegraph: | ||
name: Generate Flamegraph for load test | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@v4 | ||
|
||
- name: Rustup toolchain install | ||
uses: dtolnay/rust-toolchain@stable | ||
with: | ||
toolchain: ${{ env.RUST_VERSION }} | ||
|
||
- name: Install flamegraph | ||
run: cargo install flamegraph | ||
|
||
- name: Caching | ||
uses: Swatinem/rust-cache@v2 | ||
|
||
- name: Generate Flamegraph for Ethrex | ||
run: | | ||
sh .github/scripts/flamegraph.sh |