Skip to content

Commit

Permalink
engine: add more code to stress-ng if statement
Browse files Browse the repository at this point in the history
Signed-off-by: Douglas Schilling Landgraf <[email protected]>
  • Loading branch information
dougsland committed Jul 24, 2024
1 parent 0f40c8b commit 1a01c08
Showing 1 changed file with 24 additions and 24 deletions.
48 changes: 24 additions & 24 deletions engine
Original file line number Diff line number Diff line change
Expand Up @@ -253,31 +253,31 @@ main() {
echo "Failed to run stress-ng. Exiting."
exit 1
fi
fi

# Find the process IDs (PIDs) of running stress-ng processes,
# remove duplicates, and store the output in the stress_pids
# variable
stress_pids=$(pgrep stress-ng | uniq | while read pid; do
# Extract the second argument of the stress-ng command to
# determine the stressor type
stress_type=$(ps -p $pid -o args= | awk '{print $2}')
# If no specific stressor type is found, output the PID with
# 'stress-ng'
if [ -z "$stress_type" ]; then
echo "$pid stress-ng"
else
# Otherwise, append the stressor type to 'stress-ng' and
# output it with the PID
echo "$pid stress-ng-$stress_type"
fi
done)

# Run monitor with stress-ng pids
stress_pids=$(pgrep stress-ng)
MONITOR_INTERVAL_SEC=5
system_ongoing ${MONITOR_INTERVAL_SEC} ${stress_pids[@]}
# Find the process IDs (PIDs) of running stress-ng processes,
# remove duplicates, and store the output in the stress_pids
# variable
stress_pids=$(pgrep stress-ng | uniq | while read pid; do
# Extract the second argument of the stress-ng command to
# determine the stressor type
stress_type=$(ps -p $pid -o args= | awk '{print $2}')
# If no specific stressor type is found, output the PID with
# 'stress-ng'
if [ -z "$stress_type" ]; then
echo "$pid stress-ng"
else
# Otherwise, append the stressor type to 'stress-ng' and
# output it with the PID
echo "$pid stress-ng-$stress_type"
fi
done)
# Run monitor with stress-ng pids
stress_pids=$(pgrep stress-ng)
MONITOR_INTERVAL_SEC=5
system_ongoing ${MONITOR_INTERVAL_SEC} ${stress_pids[@]}
fi
;;
remove)
Expand Down

0 comments on commit 1a01c08

Please sign in to comment.