-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rewrite nems-stress to output averages, add frequency
- Loading branch information
NEMS Linux
committed
Sep 3, 2019
1 parent
b50e68e
commit ca50fd0
Showing
1 changed file
with
31 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,40 @@ | ||
#!/bin/bash | ||
|
||
# This stress test will run for 5 minutes | ||
if [[ ! -f /usr/bin/stress ]]; then | ||
apt -y install stress | ||
fi | ||
|
||
cores=8 | ||
# How many minutes to run for | ||
minutes=5 | ||
|
||
printf "Running test for $minutes minutes" | ||
|
||
touch /var/log/nems-stress-temperature.log | ||
touch /var/log/nems-stress-frequency.log | ||
|
||
# Bring it to its knees... | ||
cores=$(nproc --all) | ||
stress --cpu $cores --timeout $((${minutes} * 60)) > /dev/null 2>&1 & | ||
stress --cpu $cores --timeout $((${minutes} * 60)) > /dev/null 2>&1 & | ||
stress --cpu $cores --timeout $((${minutes} * 60)) > /dev/null 2>&1 & | ||
|
||
# main test runs for 20 minutes, constantly | ||
stress --cpu $cores --timeout 1200 & | ||
iterations=$((${minutes} * 6)) | ||
while [ $iterations -gt 0 ]; | ||
do | ||
temperature=$(/usr/local/bin/nems-info temperature) | ||
frequency=$(/usr/local/bin/nems-info frequency) | ||
echo $temperature >> /var/log/nems-stress-temperature.log | ||
echo $frequency >> /var/log/nems-stress-frequency.log | ||
# Total sleep time of 10 seconds, with a period every 2 seconds | ||
printf "." && sleep 2 && printf "." && sleep 2 && printf "." && sleep 2 && printf "." && sleep 2 && printf "." && sleep 2 | ||
iterations=$(($iterations-1)) | ||
done | ||
|
||
# After 5 minutes, increase the load, for 15 minutes | ||
sleep 300 && stress --cpu $cores --timeout 900 & | ||
echo "" | ||
|
||
# Get serious 10 minutes in and crank out 5 minutes of doom | ||
sleep 300 && stress --cpu $cores --timeout 300 & | ||
averagetemperature=$(awk '{ total += $2; count++ } END { print total/count }' /var/log/nems-stress-temperature.log) | ||
echo "Average Temperature: $averagetemperature (Lower is better)" | ||
|
||
# the stress test will stop after the timeouts are up. | ||
averagefrequency=$(awk '{ total += $2; count++ } END { print total/count }' /var/log/nems-stress-frequency.log) | ||
echo "Average Frequency: $averagefrequency (Higher is better)" |