Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 3dbbedaec6 | |||
| 3f85cd6dd8 | |||
| 939da6f3dc | |||
| 3d68686a96 |
@@ -7,10 +7,31 @@ usage() {
|
||||
cat <<-EOF
|
||||
Usage: ${name} [-h || --help]
|
||||
|
||||
measures the pu core temperature an echoes with a squenence number to stdout.
|
||||
measures the cpu's core temperature and writes it with a timestamp to stdout.
|
||||
EOF
|
||||
}
|
||||
|
||||
#format the temperature to float value
|
||||
format_temp() {
|
||||
ftemp=${1:0:2}
|
||||
|
||||
ftemp+="."
|
||||
ftemp+=${1:2:1}
|
||||
|
||||
echo "${ftemp}"
|
||||
}
|
||||
|
||||
ZONE=/sys/class/thermal/thermal_zone0/temp
|
||||
|
||||
#retrieve the cpu's temperature from /sys/class/thermal/thermal_zone0/temp
|
||||
measure_temp() {
|
||||
cpu_temp=$(cat ${ZONE})
|
||||
|
||||
formatted_temp=$(format_temp "${cpu_temp}")
|
||||
|
||||
echo "${formatted_temp}"
|
||||
}
|
||||
|
||||
if [[ "$1" == "-h" || "$1" == "--help" ]]; then
|
||||
usage
|
||||
exit 0
|
||||
@@ -19,8 +40,8 @@ fi
|
||||
while true; do
|
||||
NOW=$(date +%s)
|
||||
TS=$((NOW - START))
|
||||
TEMP=$(vcgencmd measure_temp | sed 's/[^0-9.]//g')
|
||||
echo "$TS $TEMP"
|
||||
TEMP=$(measure_temp)
|
||||
echo "${TS} ${TEMP}"
|
||||
sleep 1
|
||||
done
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ fi
|
||||
|
||||
verbose=false
|
||||
COLOR='red'
|
||||
PADDING=5
|
||||
PADDING=0
|
||||
|
||||
VALID_ARGS=$(getopt -o vho:c:t:l: --long verbose,help,output,color:,title:,logfile: -- "$@")
|
||||
if [[ $? -ne 0 ]]; then
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
export FIO_NUMJOBS=$(nproc)
|
||||
measure_temp.sh > ${1} &
|
||||
TPID=$!
|
||||
fio ~/git/pistress/fio/fio_cpu
|
||||
fio ${PISTRESS_HOME}/fio/fio_cpu
|
||||
kill $TPID > /dev/null
|
||||
unset FIO_NUMJOBS
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ cpuchunks=100000
|
||||
runtime=3600
|
||||
time_based
|
||||
group_reporting
|
||||
numjobs=4
|
||||
numjobs=${FIO_NUMJOBS}
|
||||
|
||||
[cpu-stress]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user