Skip to content

Commit

Permalink
Monitoring addition
Browse files Browse the repository at this point in the history
  • Loading branch information
sagar-qa007 committed Jan 1, 2025
1 parent 1c03b30 commit 26a25a8
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/ci-test-hosted.yml
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,12 @@ jobs:
echo "COMMIT_INFO_MESSAGE=Manual workflow run for Hosted tests" >> $GITHUB_ENV
fi
- name: Monitor Resource Usage
run: |
echo "Monitoring system metrics during Cypress tests..."
nohup bash -c 'while true; do echo "==== CPU & RAM Usage ===="; top -b -n 1 | head -n 10; echo "==== Disk Usage ===="; df -h; sleep 10; done' > resource_usage.log &
echo $! > resource_monitor_pid
- name: Run the cypress test
uses: cypress-io/github-action@v6
env:
Expand Down Expand Up @@ -252,6 +258,17 @@ jobs:
working-directory: app/client
env: "NODE_ENV=development"

- name: Stop Monitoring
run: |
kill $(cat resource_monitor_pid) || true
echo "Resource monitoring stopped."
- name: Upload Resource Usage Log
uses: actions/upload-artifact@v3
with:
name: resource-usage-log
path: resource_usage.log

- name: Rename reports
if: failure()
run: |
Expand Down

0 comments on commit 26a25a8

Please sign in to comment.