Skip to content

Commit

Permalink
Simplify flamegraph script into a single one.
Browse files Browse the repository at this point in the history
  • Loading branch information
dsocolobsky committed Dec 6, 2024
1 parent 201ab7a commit bf2cf6c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 29 deletions.
25 changes: 0 additions & 25 deletions .github/scripts/flamegraph_reth.sh

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
#!/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.

iterations=1000
value=10000000
account=0x33c6b73432B3aeA0C1725E415CC40D04908B85fd
Expand All @@ -17,9 +22,9 @@ 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"
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"
8 changes: 6 additions & 2 deletions .github/workflows/flamegraph_reporter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ jobs:
flamegraph-ethrex:
name: Generate Flamegraph for Ethrex
runs-on: ubuntu-latest
env:
PROGRAM: ethrex
outputs:
time: ${{steps.generate-flamegraph-ethrex.outputs.time}}
steps:
Expand Down Expand Up @@ -65,7 +67,7 @@ jobs:
echo "waiting to execute load test..."
sleep 30 &&
echo "executing load test..."
bash .github/scripts/flamegraph.sh &&
bash /home/runner/work/ethrex/ethrex/.github/scripts/flamegraph-watcher.sh &&
echo "Load test finished"
- name: Generate SVG
Expand All @@ -84,6 +86,8 @@ jobs:
flamegraph-reth:
name: Generate Flamegraph for Reth
runs-on: ubuntu-latest
env:
PROGRAM: reth
outputs:
time: ${{steps.generate-flamegraph-reth.outputs.time}}
steps:
Expand Down Expand Up @@ -135,7 +139,7 @@ jobs:
--txpool.basefee-max-size 1000000000000 --txpool.queued-max-count 1000000000 &
echo "waiting to execute load test..."
sleep 180 &&
bash /home/runner/work/ethrex/ethrex/.github/scripts/flamegraph_reth.sh &&
bash /home/runner/work/ethrex/ethrex/.github/scripts/flamegraph-watcher.sh &&
echo "Load test finished"
- name: Generate SVG
Expand Down

0 comments on commit bf2cf6c

Please sign in to comment.