|
20 | 20 | - uses: webfactory/[email protected] |
21 | 21 | with: |
22 | 22 | 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 & |
23 | 40 | - name: Benches |
24 | 41 | run: | |
25 | 42 | export HCLOUD_TOKEN=${{ secrets.HCLOUD_TOKEN }} |
|
30 | 47 | export POSTGRES_TABLE=benchmark_manual |
31 | 48 | bash -x tools/setup_ci.sh |
32 | 49 | 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