Skip to content
Permalink
Browse files

Show frequency when hot

  • Loading branch information...
NEMS Linux
NEMS Linux committed Sep 11, 2019
1 parent 9be85d8 commit f72e5e4e4652a8f3bf6989c454997b20e47d15e3
Showing with 20 additions and 6 deletions.
  1. +20 −6 nems-stress
@@ -20,6 +20,7 @@ lowtemperature=$temperature
toptemperature=$temperature
lowfrequency=$frequency
topfrequency=$frequency
frequencywhenhot=999999999999

# Bring this NEMS Server to its knees...
cores=$(nproc --all)
@@ -38,19 +39,26 @@ while [ $iterations -gt 0 ];
do
temperature=$(/usr/local/bin/nems-info temperature)
frequency=$(/usr/local/bin/nems-info frequency)

echo $frequency >> /var/log/nems/nems-stress-frequency.log
if [[ "$frequency" < "$lowfrequency" ]]; then
lowfrequency=$frequency
fi
if [[ "$frequency" > "$topfrequency" ]]; then
topfrequency=$frequency
fi

echo $temperature >> /var/log/nems/nems-stress-temperature.log
if [[ "$temperature" < "$lowtemperature" ]]; then
lowtemperature=$temperature
fi
if [[ "$temperature" > "$toptemperature" ]]; then
toptemperature=$temperature
fi
echo $frequency >> /var/log/nems/nems-stress-frequency.log
if [[ "$frequency" < "$lowfrequency" ]]; then
lowfrequency=$frequency
fi
if [[ "$frequency" > "$topfrequency" ]]; then
topfrequency=$frequency
if [[ "$temperature" > "80" ]]; then
if [[ "$frequency" < "$frequencywhenhot" ]]; then
frequencywhenhot=$frequency
fi
fi
# 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
@@ -64,8 +72,14 @@ echo "Lowest Temperature: $lowtemperature"
echo "Highest Temperature: $toptemperature"
echo "Slowest Speed: $lowfrequency"
echo "Maximum Speed: $topfrequency"
echo ""
echo "When the board was hot, the frequency was: $frequencywhenhot"
echo ""

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 += $1; count++ } END { print total/count }' /var/log/nems/nems-stress-frequency.log)
echo "Average Frequency: $averagefrequency (Higher is better)"

echo ""

0 comments on commit f72e5e4

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