Skip to content
Permalink
Browse files

Fix average output and relocate stress logs

  • Loading branch information...
NEMS Linux
NEMS Linux committed Sep 7, 2019
1 parent 77a7024 commit b82792616f45ecd96ae9eb1a90f16f9603b5cdf5
Showing with 6 additions and 6 deletions.
  1. +6 −6 nems-stress
@@ -10,8 +10,8 @@ minutes=5

printf "Running test for $minutes minutes"

touch /var/log/nems-stress-temperature.log
touch /var/log/nems-stress-frequency.log
touch /var/log/nems/nems-stress-temperature.log
touch /var/log/nems/nems-stress-frequency.log

# Bring it to its knees...
cores=$(nproc --all)
@@ -24,17 +24,17 @@ 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
echo $temperature >> /var/log/nems/nems-stress-temperature.log
echo $frequency >> /var/log/nems/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

echo ""

averagetemperature=$(awk '{ total += $2; count++ } END { print total/count }' /var/log/nems-stress-temperature.log)
averagetemperature=$(awk '{ total += $1; count++ } END { print total/count }' /var/log/nems/nems-stress-temperature.log)
echo "Average Temperature: $averagetemperature (Lower is better)"

averagefrequency=$(awk '{ total += $2; count++ } END { print total/count }' /var/log/nems-stress-frequency.log)
averagefrequency=$(awk '{ total += $1; count++ } END { print total/count }' /var/log/nems/nems-stress-frequency.log)
echo "Average Frequency: $averagefrequency (Higher is better)"

0 comments on commit b827926

Please sign in to comment.
You can’t perform that action at this time.