Skip to content

Commit

Permalink
Update deployed page with generated flamegraphs 2
Browse files Browse the repository at this point in the history
  • Loading branch information
dsocolobsky committed Dec 5, 2024
1 parent b128f48 commit 9a7c430
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 9 deletions.
3 changes: 2 additions & 1 deletion .github/scripts/flamegraph.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ retries=0
while [[ $output -le $end_val && $retries -lt 30 ]]; do
sleep 5
output=$(cast balance $account --rpc-url=http://localhost:1729 2>&1)
echo "balance was $output still not reached value of $end_val"
echo "balance was $output still not reached value of $end_val (retry $retries/30)"
((retries++))
done
echo "Done. Balance of $output reached, killing process ethrex"
sudo pkill ethrex && while pgrep -l "cargo-flamegraph"; do echo "waiting for reth to exit... "; sleep 1;done;
Expand Down
6 changes: 4 additions & 2 deletions .github/scripts/flamegraph_reth.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@ ethrex_l2 test load --path /home/runner/work/ethrex/ethrex/test_data/private_key

echo "Monitoring..."
output=$(cast balance $account --rpc-url=http://localhost:1729 2>&1)
while [[ $output -le $end_val ]]; do
retries=0
while [[ $output -le $end_val && $retries -lt 30 ]]; do
sleep 5
output=$(cast balance $account --rpc-url=http://localhost:1729 2>&1)
echo "balance was $output still not reached value of $end_val"
echo "balance was $output still not reached value of $end_val (retry $retries/30)"
((retries++))
done
echo "Balance of $output reached, killing process reth"

Expand Down
16 changes: 10 additions & 6 deletions .github/workflows/flamegraph_reporter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -167,21 +167,25 @@ jobs:
- name: Download ethrex flamegraph artifact
uses: actions/download-artifact@v4
with:
name: flamegraph_ethrex
name: flamegraph_ethrex.svg
path: flamegraph_ethrex.svg

- name: Download reth flamegraph artifact
uses: actions/download-artifact@v4
with:
name: flamegraph_reth
name: flamegraph_reth.svg
path: flamegraph_reth.svg

- name: Update static page locally with new data
shell: bash
run: |
cp flamegraph_ethrex.svg pages/
cp flamegraph_reth.svg pages/
echo "NOW=$(date +'%Y-%m-%dT%H:%M:%S')" >> $GITHUB_ENV
sed -i "s/{{LAST_UPDATE}}/$NOW/g" pages/index.html
file flamegraph_ethrex.svg
file flamegraph_reth.svg
cp -r flamegraph_ethrex.svg pages/
cp -r flamegraph_reth.svg pages/
ls -las pages/
date +'%Y-%m-%dT%H:%M:%S'
sed -i "s/{{LAST_UPDATE}}/$(date +'%Y-%m-%dT%H:%M:%S')/g" pages/index.html
- name: Setup Pages
uses: actions/configure-pages@v5
Expand Down

0 comments on commit 9a7c430

Please sign in to comment.