-
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.
Simplify flamegraph script into a single one.
- Loading branch information
1 parent
201ab7a
commit 6b0c5e2
Showing
4 changed files
with
580 additions
and
597 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
18 changes: 11 additions & 7 deletions
18
.github/scripts/flamegraph.sh → .github/scripts/flamegraph_watcher.sh
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 |
---|---|---|
@@ -1,25 +1,29 @@ | ||
#!/bin/bash | ||
|
||
# This script sends 1000 transactions to a test account, per defined private key | ||
# then polls the account balance until the expected balance has been reached | ||
# and then kills the process. It also measures the elapsed time of the test and | ||
# outputs it to Github Action's outputs. | ||
SECONDS=0 | ||
|
||
iterations=1000 | ||
value=10000000 | ||
account=0x33c6b73432B3aeA0C1725E415CC40D04908B85fd | ||
end_val=$((172 * $iterations * $value)) | ||
|
||
ethrex_l2 test load --path /home/runner/work/ethrex/ethrex/test_data/private_keys.txt -i $iterations -v --value $value --to $account | ||
|
||
start_time=$(date +%s) | ||
output=$(cast balance $account --rpc-url=http://localhost:1729 2>&1) | ||
while [[ $output -le $end_val ]]; do | ||
sleep 5 | ||
output=$(cast balance $account --rpc-url=http://localhost:1729 2>&1) | ||
done | ||
end_time=$(date +%s) | ||
elapsed_time=$((end_time - start_time)) | ||
minutes=$((elapsed_time / 60)) | ||
seconds=$((elapsed_time % 60)) | ||
echo "Balance of $output reached in $minutes min $seconds s, killing process ethrex" | ||
elapsed=$SECONDS | ||
minutes=$((elapsed / 60)) | ||
seconds=$((elapsed % 60)) | ||
echo "Balance of $output reached in $minutes min $seconds s, killing process" | ||
|
||
sudo pkill ethrex && while pgrep -l "cargo-flamegraph"; do echo "waiting for reth to exit... "; sleep 1;done; | ||
sudo pkill "$PROGRAM" && while pgrep -l "cargo-flamegraph"; do echo "waiting for $PROGRAM to exit... "; sleep 1;done; | ||
|
||
# We need this for the following job, to add to the static page | ||
echo "time=$minutes minutes $seconds seconds" >> "$GITHUB_OUTPUT" |
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
Oops, something went wrong.