Skip to content

Commit

Permalink
v6.17
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Knight committed Sep 30, 2018
1 parent 7426491 commit 02da1a8
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
2 changes: 2 additions & 0 deletions dietpi/dietpi-survey
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@ BENCH_ROOTFS_WRITE=$(sed -n 2p /var/lib/dietpi/dietpi-benchmark/upload_results)
BENCH_ROOTFS_READ=$(sed -n 3p /var/lib/dietpi/dietpi-benchmark/upload_results)
BENCH_RAM_WRITE=$(sed -n 4p /var/lib/dietpi/dietpi-benchmark/upload_results)
BENCH_RAM_READ=$(sed -n 5p /var/lib/dietpi/dietpi-benchmark/upload_results)
BENCH_CPU_TEMP_START=$(sed -n 6p /var/lib/dietpi/dietpi-benchmark/upload_results)
BENCH_CPU_TEMP_END=$(sed -n 7p /var/lib/dietpi/dietpi-benchmark/upload_results)
_EOF_

fi
Expand Down
19 changes: 14 additions & 5 deletions dietpi/func/dietpi-benchmark
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@

CPUBENCH_TIME='Not tested'
CPUBENCH_INT_MAX=${CPUBENCH_INT_MAX:-1000000} #optional input
BENCH_CPU_TEMP_START=0
BENCH_CPU_TEMP_END=0
CPU_Benchmark(){

G_DIETPI-NOTIFY 0 "Running DietPi-CPU Benchmark with max value of 1000000 over $(nproc --all) cores, please wait..."
Expand Down Expand Up @@ -96,16 +98,20 @@ _EOF_
sync
sleep 1

BENCH_CPU_TEMP_START=$(G_OBTAIN_CPU_TEMP)

{ time -p $FP_TEMP/bench; } 2> $FP_TEMP/bench_result

BENCH_CPU_TEMP_END=$(G_OBTAIN_CPU_TEMP)
CPUBENCH_TIME=$( grep -m1 'real' $FP_TEMP/bench_result | awk '{print $2}' )

if (( $SHOW_RESULTS )); then

G_WHIP_MSG "CPU Benchmark Results:\n
- Total time = $CPUBENCH_TIME Seconds
- Value to reach = $CPUBENCH_INT_MAX\n\n
NB: A lower 'Total time' is faster"
- Value to reach = $CPUBENCH_INT_MAX
- CPU temps = Start: ${BENCH_CPU_TEMP_START}'c | End: ${BENCH_CPU_TEMP_END}'c\n\n
NB: A lower 'Total time' is faster"

fi

Expand Down Expand Up @@ -226,14 +232,17 @@ $rootfs_write
$rootfs_read
$ram_write
$ram_read
$BENCH_CPU_TEMP_START
$BENCH_CPU_TEMP_END
_EOF_

#SHOW_RESULTS=1

G_WHIP_MSG "Benchmarks completed:
CPU : Total time $CPUBENCH_INT_MAX int = $CPUBENCH_TIME seconds
RAM : Write = $ram_write MB/s | Read = $ram_read MB/s
RootFS : Write = $rootfs_write MB/s | Read = $rootfs_read MB/s"
CPU : Total time $CPUBENCH_INT_MAX int = $CPUBENCH_TIME seconds
RAM : Write = $ram_write MB/s | Read = $ram_read MB/s
RootFS : Write = $rootfs_write MB/s | Read = $rootfs_read MB/s
CPU temp : Start = ${BENCH_CPU_TEMP_START}'c | End = ${BENCH_CPU_TEMP_END}'c"

# - Upload
/DietPi/dietpi/dietpi-survey 1
Expand Down

0 comments on commit 02da1a8

Please sign in to comment.