Skip to content

Commit bec51f9

Browse files
committed
Simplify flamegraph script into a single one.
1 parent 201ab7a commit bec51f9

File tree

3 files changed

+13
-29
lines changed

3 files changed

+13
-29
lines changed

.github/scripts/flamegraph_reth.sh

Lines changed: 0 additions & 25 deletions
This file was deleted.

.github/scripts/flamegraph.sh renamed to .github/scripts/flamegraph_watcher.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
#!/bin/bash
22

3+
# This script sends 1000 transactions to a test account, per defined private key
4+
# then polls the account balance until the expected balance has been reached
5+
# and then kills the process. It also measures the elapsed time of the test and
6+
# outputs it to Github Action's outputs.
7+
38
iterations=1000
49
value=10000000
510
account=0x33c6b73432B3aeA0C1725E415CC40D04908B85fd
@@ -17,9 +22,9 @@ end_time=$(date +%s)
1722
elapsed_time=$((end_time - start_time))
1823
minutes=$((elapsed_time / 60))
1924
seconds=$((elapsed_time % 60))
20-
echo "Balance of $output reached in $minutes min $seconds s, killing process ethrex"
25+
echo "Balance of $output reached in $minutes min $seconds s, killing process"
2126

22-
sudo pkill ethrex && while pgrep -l "cargo-flamegraph"; do echo "waiting for reth to exit... "; sleep 1;done;
27+
sudo pkill "$PROGRAM" && while pgrep -l "cargo-flamegraph"; do echo "waiting for $PROGRAM to exit... "; sleep 1;done;
2328

2429
# We need this for the following job, to add to the static page
2530
echo "time=$minutes minutes $seconds seconds" >> "$GITHUB_OUTPUT"

.github/workflows/flamegraph_reporter.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ jobs:
2020
flamegraph-ethrex:
2121
name: Generate Flamegraph for Ethrex
2222
runs-on: ubuntu-latest
23+
env:
24+
PROGRAM: ethrex
2325
outputs:
2426
time: ${{steps.generate-flamegraph-ethrex.outputs.time}}
2527
steps:
@@ -65,7 +67,7 @@ jobs:
6567
echo "waiting to execute load test..."
6668
sleep 30 &&
6769
echo "executing load test..."
68-
bash .github/scripts/flamegraph.sh &&
70+
bash /home/runner/work/ethrex/ethrex/.github/scripts/flamegraph_watcher.sh &&
6971
echo "Load test finished"
7072
7173
- name: Generate SVG
@@ -84,6 +86,8 @@ jobs:
8486
flamegraph-reth:
8587
name: Generate Flamegraph for Reth
8688
runs-on: ubuntu-latest
89+
env:
90+
PROGRAM: reth
8791
outputs:
8892
time: ${{steps.generate-flamegraph-reth.outputs.time}}
8993
steps:
@@ -135,7 +139,7 @@ jobs:
135139
--txpool.basefee-max-size 1000000000000 --txpool.queued-max-count 1000000000 &
136140
echo "waiting to execute load test..."
137141
sleep 180 &&
138-
bash /home/runner/work/ethrex/ethrex/.github/scripts/flamegraph_reth.sh &&
142+
bash /home/runner/work/ethrex/ethrex/.github/scripts/flamegraph_watcher.sh &&
139143
echo "Load test finished"
140144
141145
- name: Generate SVG

0 commit comments

Comments
 (0)