Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions generateDataAndRun.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,21 @@ set -e
# Rotate log files
logrotate -s logrotate.state logrotate.conf

# Start background monitor
(while true; do
echo "[$(date +%T)] --- VITALS ---"
# RAM usage
echo "Memory: $(free -h | awk 'NR==2{print $3 \" / \" $2}')"
# Disk usage for the current workspace
echo "Disk: $(df -h . | awk 'NR==2{print $3 \" used / \" $4 \" avail (\" $5 \")\"}')"
# CPU Load
echo "CPU Load: $(cut -d' ' -f1-3 /proc/loadavg)"
echo "------------------------"
sleep 30
done) &
MONITOR_PID=$!
Comment thread
sffc marked this conversation as resolved.
trap 'kill $MONITOR_PID 2>/dev/null' EXIT

##########
# Setup (generate) test data & expected values
##########
Expand Down Expand Up @@ -162,6 +177,7 @@ popd
# Push testresults and test reports to Cloud Storge
# TODO
echo "End-to-end script finished successfully"
kill $MONITOR_PID
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

If a trap is implemented to handle the cleanup of the background monitor process, this explicit kill command becomes redundant and can be removed to avoid potential 'No such process' errors during exit.


# Clean up directory
# ... after results are reported
Expand Down
Loading