Skip to content

Commit

Permalink
fix: calculate time to process the balance
Browse files Browse the repository at this point in the history
  • Loading branch information
fborello-lambda committed Jan 9, 2025
1 parent 18e96a5 commit 23e3b49
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
11 changes: 10 additions & 1 deletion .github/scripts/flamegraph_watcher.sh
Original file line number Diff line number Diff line change
@@ -1,16 +1,25 @@
#!/bin/bash

# This script sends 171 * 500 transactions to a test account, per defined private key
# This script sends 171 * <iterations> 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.
iterations=50
value=1
account=0x33c6b73432B3aeA0C1725E415CC40D04908B85fd
end_val=$((171 * $iterations * $value))

start_time=$(date +%s)
ethrex_l2 test load --path /home/runner/work/ethrex/ethrex/test_data/private_keys.txt -i $iterations -v --value $value --to $account >/dev/null

output=$(ethrex_l2 info -b -a $account 2>&1)

while [[ $output -lt $end_val ]]; do
sleep 5
output=$(ethrex_l2 info -b -a $account 2>&1)
done
end_time=$(date +%s)

elapsed=$((end_time - start_time))

minutes=$((elapsed / 60))
Expand Down
11 changes: 10 additions & 1 deletion scripts/flamegraph.sh
Original file line number Diff line number Diff line change
@@ -1,16 +1,25 @@
#!/bin/bash

# This script sends 171 * 500 transactions to a test account, per defined private key
# This script sends 171 * <iterations> 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.
iterations=500
value=1
account=0x33c6b73432B3aeA0C1725E415CC40D04908B85fd
end_val=$((171 * $iterations * $value))

start_time=$(date +%s)
ethrex_l2 test load --path ./test_data/private_keys.txt -i $iterations -v --value $value --to $account >/dev/null

output=$(ethrex_l2 info -b -a $account 2>&1)

while [[ $output -lt $end_val ]]; do
sleep 5
output=$(ethrex_l2 info -b -a $account 2>&1)
done
end_time=$(date +%s)

elapsed=$((end_time - start_time))

minutes=$((elapsed / 60))
Expand Down

0 comments on commit 23e3b49

Please sign in to comment.