Skip to content

Commit 7e5663e

Browse files
committed
add runner resources monitoring
1 parent 132c480 commit 7e5663e

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

.github/workflows/manual-benchmark.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,23 @@ jobs:
2020
- uses: webfactory/[email protected]
2121
with:
2222
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
23+
- name: Setup monitoring script
24+
run: |
25+
echo '#!/bin/bash' > monitor.sh
26+
echo 'while true; do' >> monitor.sh
27+
echo ' echo "CPU usage at $(date):" >> system_resources.log' >> monitor.sh
28+
echo ' top -b -n 1 | head -n 20 >> system_resources.log' >> monitor.sh
29+
echo ' echo "" >> system_resources.log' >> monitor.sh
30+
echo ' echo "Memory usage at $(date):" >> system_resources.log' >> monitor.sh
31+
echo ' free -h >> system_resources.log' >> monitor.sh
32+
echo ' echo "" >> system_resources.log' >> monitor.sh
33+
echo ' echo "Disk usage at $(date):" >> system_resources.log' >> monitor.sh
34+
echo ' df -h >> system_resources.log' >> monitor.sh
35+
echo ' sleep 10' >> monitor.sh
36+
echo 'done' >> monitor.sh
37+
chmod +x monitor.sh
38+
- name: Start monitoring in background
39+
run: ./monitor.sh &
2340
- name: Benches
2441
run: |
2542
export HCLOUD_TOKEN=${{ secrets.HCLOUD_TOKEN }}
@@ -30,3 +47,13 @@ jobs:
3047
export POSTGRES_TABLE=benchmark_manual
3148
bash -x tools/setup_ci.sh
3249
bash -x tools/run_ci.sh
50+
- name: Stop monitoring
51+
run: |
52+
pkill -f monitor.sh
53+
- name: Display resource log
54+
run: cat system_resources.log
55+
- name: Upload system resource log
56+
uses: actions/upload-artifact@v2
57+
with:
58+
name: system-resources-log
59+
path: system_resources.log

0 commit comments

Comments
 (0)