From 5a9a9a2f7ba542a143ed9a559dfccf514c024298 Mon Sep 17 00:00:00 2001 From: PrincessPi3 Date: Tue, 4 Nov 2025 12:04:57 -0700 Subject: [PATCH] 1762283097 --- customscripts/cmdlist.txt | 12 ++++++------ customscripts/measure_performance | 11 +++-------- 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/customscripts/cmdlist.txt b/customscripts/cmdlist.txt index caa3624..dbd6622 100644 --- a/customscripts/cmdlist.txt +++ b/customscripts/cmdlist.txt @@ -1,8 +1,8 @@ sleep 10 wget https://github.com/espressif/esp-idf/releases/download/v5.5.1/esp-idf-v5.5.1.zip -P /tmp/file.tmp -oniux curl -s https://canhazip.com >/dev/null -oniux curl -s https://canhazip.com >/dev/null -oniux curl -s https://canhazip.com >/dev/null -oniux curl -s https://canhazip.com >/dev/null -oniux curl -s https://canhazip.com >/dev/null -rm -f /tmp/file.tmp >/dev/null \ No newline at end of file +oniux curl -s https://canhazip.com +oniux curl -s https://canhazip.com +oniux curl -s https://canhazip.com +oniux curl -s https://canhazip.com +oniux curl -s https://canhazip.com +rm -f /tmp/file.tmp \ No newline at end of file diff --git a/customscripts/measure_performance b/customscripts/measure_performance index 4ee0095..855b27b 100644 --- a/customscripts/measure_performance +++ b/customscripts/measure_performance @@ -42,7 +42,7 @@ measure_performance () { start_unixmicroseconds=$(date +"%s%6N") # get start microseconds fast as possible before run # run the command with pidstart (-e) - eval "pidstat -h -H -d -r -u -I $poll_seconds -e bash -c \"$test_cmd\" >> \"$logfile\"" + eval "pidstat -h -H -d -r -u -I $poll_seconds -e $test_cmd >> $logfile" ret=$? # get da return code # calculate durations @@ -58,13 +58,9 @@ measure_performance () { # nao add da rest echo -e "Duration Seconds: $duration_seconds\nDuration Microseconds: $duration_microseconds\nReturn Code: $ret" else - if [ -f "$csv_file" ]; then - rm -f "$csv_file" - fi - elapsed_seconds=$((`date +%s` - $start_seconds)) # parse and appand dem 2 da csv - cat "$logfile" | sed -n '/^[0-9]/p' | tr -s ' ' ',' | awk -F, "{cpup+=\$8;memk+=\$13;memp=\$14;rkbs+=\$15;wkbs+=\$15}{print \"$position\",cpup/NR,memk/NR,memp/NR,rkbs/NR,wkbs/NR,\"$duration_microseconds\",\"$test_cmd\",\"$ret\",\"$elapsed_seconds\"}" >> "$csv_file" + cat "$logfile" | sed -n '/^[0-9]/p' | tr -s ' ' ',' | awk -F, "{cpup+=\$8;memk+=\$13;memp=\$14;rkbs+=\$15;wkbs+=\$15}{print \"$position\",cpup/NR,memk/NR,memp/NR,rkbs/NR,wkbs/NR,\"$duration_microseconds\",\"$test_cmd\",\"$ret\",\"$elapsed_seconds\"}" | tee -a "$csv_file" # cat "$logfile" | sed '/^#\|^$\|^Linux/d' | tr -s ' ' ',' | awk -F, "{cpup+= \$8;memk+=\$13;memp +=\$14;rkbs+=\$15;wkbs+=\$16 } END {print \"$position\",\",\",cpup/NR,\",\",memk/NR,\",\",memp/NR,\",\",rkbs/NR,\",\",wkbs/NR,\",\",\"$duration_microseconds\",\",\",\"$test_cmd\",\",\",\"$ret\",\",\",\"$elapsed_seconds\"}" | tr -d ' ' | tee -a "$csv_file" fi } @@ -79,7 +75,6 @@ if [ ! -f "$input" ]; then ## if batch mode else # settans - results_log=$1.csv # todo: do file ext trickery len=$(wc -l "$input" | awk '{print $1}') # num of lines in da fiel count=1 @@ -88,7 +83,7 @@ else # fi # add da csv headers to the results fiel - echo "0Position,CPU %,Memory (KiB),Memory %,KiB Read/Second,KiB Written/Second,Duration Microseconds,Command,Return Code,Seconds Elapsed" >> "$csv_file" + echo "0Position,CPU %,Memory (KiB),Memory %,KiB Read/Second,KiB Written/Second,Duration Microseconds,Command,Return Code,Seconds Elapsed" > "$csv_file" cat "$input" | \ while read line; do