4 Commits
1.01 ... 1.04

Author SHA1 Message Date
bf87653e77 updated Version 2026-06-04 19:39:37 +00:00
8e6ea348cc configure default values in ~/pistressrc if exists 2026-06-04 11:38:50 +00:00
3dbbedaec6 replced vcgencmd call with internal function. 2026-06-04 11:09:41 +00:00
3f85cd6dd8 bin/measure_temp.sh aktualisiert
typos
2026-06-02 11:19:43 +00:00
5 changed files with 46 additions and 9 deletions

6
.pistressrc Normal file
View File

@@ -0,0 +1,6 @@
export PISTRESS_HOME=/home/pi/git/pistress
export THERMAL_ZONE=/sys/class/thermal/thermal_zone0/temp
export FIO_NUMJOBS=$(nproc)
export FIO_RUNNING_TIME=3600

View File

@@ -7,10 +7,30 @@ usage() {
cat <<-EOF cat <<-EOF
Usage: ${name} [-h || --help] 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 EOF
} }
#format the temperature to float value
format_temp() {
ftemp=${1:0:2}
ftemp+="."
ftemp+=${1:2:1}
echo "${ftemp}"
}
#retrieve the cpu's temperature from /sys/class/thermal/thermal_zone0/temp
measure_temp() {
cpu_temp=$(cat ${THERMAL_ZONE})
formatted_temp=$(format_temp "${cpu_temp}")
echo "${formatted_temp}"
}
if [[ "$1" == "-h" || "$1" == "--help" ]]; then if [[ "$1" == "-h" || "$1" == "--help" ]]; then
usage usage
exit 0 exit 0
@@ -19,8 +39,8 @@ fi
while true; do while true; do
NOW=$(date +%s) NOW=$(date +%s)
TS=$((NOW - START)) TS=$((NOW - START))
TEMP=$(vcgencmd measure_temp | sed 's/[^0-9.]//g') TEMP=$(measure_temp)
echo "$TS $TEMP" echo "${TS} ${TEMP}"
sleep 1 sleep 1
done done

View File

@@ -1,5 +1,5 @@
#!/bin/bash #! /usr/bin/env bash
VERSION="1.00" VERSION="1.04"
usage() { usage() {
local name=${0##*/} local name=${0##*/}
@@ -121,6 +121,6 @@ plot LOGFILE using 1:2 with lines lc rgb COLOR lw 2 title 'CPU-Temperatur';
" "
echo "Plot erzeugt: $OUTFILE" echo "Plot generated: ${OUTFILE}"
exit 0 exit 0

View File

@@ -1,7 +1,18 @@
export FIO_NUMJOBS=$(nproc) #! /usr/bin/env bash
if [ -f ~/.pistressrc ]; then
. ~/.pistressrc
else
export PISTRESS_HOME=/home/pi/git/pistress
export FIO_NUMJOBS=$(nproc)
export FIO_RUNNING_TIME=3600
export THERMAL_ZONE=/sys/class/thermal/thermal_zone0/temp
fi
measure_temp.sh > ${1} & measure_temp.sh > ${1} &
TPID=$! TPID=$!
fio ~/git/pistress/fio/fio_cpu fio ${PISTRESS_HOME}/fio/fio_cpu
kill $TPID > /dev/null kill $TPID > /dev/null
unset FIO_NUMJOBS unset FIO_NUMJOBS

View File

@@ -2,7 +2,7 @@
ioengine=cpuio ioengine=cpuio
cpuload=100 cpuload=100
cpuchunks=100000 cpuchunks=100000
runtime=3600 runtime=${FIO_RUNNING_TIME}
time_based time_based
group_reporting group_reporting
numjobs=${FIO_NUMJOBS} numjobs=${FIO_NUMJOBS}