From 26a25a8c6ecca82773307845c66bb7ab14d9e555 Mon Sep 17 00:00:00 2001 From: Sagar Khalasi Date: Wed, 1 Jan 2025 16:55:45 +0530 Subject: [PATCH] Monitoring addition --- .github/workflows/ci-test-hosted.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/.github/workflows/ci-test-hosted.yml b/.github/workflows/ci-test-hosted.yml index d44ab98b97f7..14af3590ca4d 100644 --- a/.github/workflows/ci-test-hosted.yml +++ b/.github/workflows/ci-test-hosted.yml @@ -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: @@ -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: |