From 2d307cadc481311216238159a9f8106f3b75d805 Mon Sep 17 00:00:00 2001 From: PrincessPi3 Date: Tue, 4 Nov 2025 11:37:16 -0700 Subject: [PATCH] waypoint --- customscripts/cmdlist.txt | 10 ++++++---- customscripts/measure_performance | 11 +++++++++-- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/customscripts/cmdlist.txt b/customscripts/cmdlist.txt index 6a8656c..caa3624 100644 --- a/customscripts/cmdlist.txt +++ b/customscripts/cmdlist.txt @@ -1,6 +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 -oniux curl -s https://canhazip.com -oniux curl -s https://canhazip.com -rm -f /tmp/file.tmp \ No newline at end of file +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 diff --git a/customscripts/measure_performance b/customscripts/measure_performance index 96e68ac..d82543e 100644 --- a/customscripts/measure_performance +++ b/customscripts/measure_performance @@ -36,7 +36,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 $test_cmd >> \"$logfile\"" + eval "pidstat -h -H -d -r -u -I $poll_seconds -e bash -c \"$test_cmd\" >> \"$logfile\"" ret=$? # get da return code # calculate durations @@ -52,13 +52,20 @@ 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 '/^#\|^$\|^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" + cat "$logfile" | sed '/^MARK*/!d' | tr -s ' ' ',' | awk -F, "{cpup+=\$8;memk+=\$13;memp=\$14;rkbs+=\$15;wkbs+=\$15}{print \"MARK$position\",cpup/NR,memk/NR,memp/NR,rkbs/NR,wkbs/NR,\"$duration_microseconds\",\"$test_cmd\",\"$ret\",\"$elapsed_seconds\"}" | tr ' ' ',' | 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 } # main +## awk testarrrr +## cat /tmp/sillylog.tmp | sed '/^#\|^$\|^Linux/d' | tr -s ' ' ',' | awk -F, '{print "Time:",$1,"UID:",$2,"PID:",$3,"%usr:",$4,"%system:",$5,"%guest:",$6,"%wait:",$7,"%CPU:",$8,"CPU:",$9,"minflt/s:",$10,"majflt/s:",$11,"VSZ:",$12,"RSS:",$13,"%MEM:",$14,"kB_rd/s:",$15,"kB_wr/s:",$16,"kB_ccwr/s:",$17,"iodelay:",$18,"Command:",$19}' ## if oneshot mode if [ ! -f "$input" ]; then test_cmd="$@"