1762264845

This commit is contained in:
2025-11-04 07:00:45 -07:00
parent 4c3289bd2f
commit d65878ff93
2 changed files with 3 additions and 58 deletions
+3 -19
View File
@@ -16,16 +16,7 @@ if [ -z "$1" ]; then
exit 1 exit 1
fi fi
echo "testing your gay little command $cmd at $(date '+%H:%M:%S %Z')" | tr [a-z] [A-Z] echo "testing your gay little command $cmd"
# kill loeg for suretain
if [ -f "$logfile" ]; then
echo "$logfile found, deleting it"
rm -f "$logfile"
fi
# csv headers
# measurements_csv_fields="TIMESTAMP,PID,CPU USAGE %,MEMORY USAGE (KIBIBYTES),MEMORY USAGE %,READ VOLUME PER SECOND (KIBIBYTES),WRITE SIZE PER SECOND (KIBIBYTES)"
# start times # start times
start_unixmicroseconds=$(date +"%s%6N") # get start microseconds fast as possible before run start_unixmicroseconds=$(date +"%s%6N") # get start microseconds fast as possible before run
# run the command with pidstat monitoring it, using eval to handle strings and args methods # run the command with pidstat monitoring it, using eval to handle strings and args methods
@@ -39,16 +30,9 @@ duration_microseconds=$(($end_unixmicroseconds - $start_unixmicroseconds))
## seconds ## seconds
duration_seconds=$(($duration_microseconds / 1000000)) # seconds = microseconds / 1,000,000 duration_seconds=$(($duration_microseconds / 1000000)) # seconds = microseconds / 1,000,000
cat "$logfile"
# remove lines starting with # (comments), empty lines, and those starting with Linux so its a pure csv # remove lines starting with # (comments), empty lines, and those starting with Linux so its a pure csv
# then squash spaces and replace with commas # then squash spaces and replace with commas
# them awk by delimiter comma to output # them awk by delimiter comma to output
# and replace da original file with tha fixed one cat "$logfile" | sed '/^#\|^$\|^Linux/d' | tr -s ' ' ',' | awk -F, '{ cpup += $8; memk += $13; memp += $14; rkbs += $15; wkbs += $15 } END { print "\nCPU:",cpup/NR,"\nMemory Usage (KiB):",memk/NR,"\nMemory Usage %:",memp/NR,"\nKiB Read Per Second:",rkbs/NR,"\nKiB Written Per Second:",wkbs/NR }' #$1,$3,$8,$13,$14,$15,$16,$17 }'
# echo $measurements_csv_fields
echo "AVERAGES: CPU% | MEMORY USAGE (KiB) | MEMORY % | READ SIZE PER SECOND (KiB) | WRITE SIZE PER SECOND (KiB)"
cat "$logfile" | sed '/^#\|^$\|^Linux/d' | tr -s ' ' ',' | awk -F, '{ cpup += $8; memk += $13; memp += $14; rkbs += $15; wkbs += $15 } END { print "%CPU: ",cpup / NR,"Memory Usage (KiB): ",memk / NR, "Memory Usage %: ",memp / NR,"\nKiB Read Per Second: ",rkbs / NR,"\nKiB Written Per Second: ",wkbs / NR }' #$1,$3,$8,$13,$14,$15,$16,$17 }'
# add footer # add footer
info_csv_fields_data="Duration Seconds: $duration_seconds Duration Microseconds: $duration_microseconds Return Code: $ret" echo -e "Duration Seconds: $duration_seconds\nDuration Microseconds: $duration_microseconds\nReturn Code: $ret"
echo $info_csv_fields_data
# cat "$logfile" | sed '/^#\|^$\|^Linux/d' | tr -s ' ' ',' | awk -F, '{ cpup += $3 } END { print "sunn:",cpup / NR }'
-39
View File
@@ -1,39 +0,0 @@
Linux 6.6.87.2-microsoft-standard-WSL2 (PrincessPi-Desk) 11/04/2025 _x86_64_ (24 CPU)
# Time UID PID %usr %system %guest %wait %CPU CPU minflt/s majflt/s VSZ RSS %MEM kB_rd/s kB_wr/s kB_ccwr/s iodelay Command
1762263417 1000 165478 98.50 1.00 0.00 0.00 4.15 6 995.00 0.00 1762980 38400 0.24 0.00 8.00 0.00 0 oniux
# Time UID PID %usr %system %guest %wait %CPU CPU minflt/s majflt/s VSZ RSS %MEM kB_rd/s kB_wr/s kB_ccwr/s iodelay Command
1762263419 1000 165478 98.00 1.50 0.00 0.00 4.15 6 976.50 0.00 1759736 47472 0.29 0.00 12.00 0.00 0 oniux
# Time UID PID %usr %system %guest %wait %CPU CPU minflt/s majflt/s VSZ RSS %MEM kB_rd/s kB_wr/s kB_ccwr/s iodelay Command
1762263421 1000 165478 96.50 3.50 0.00 0.00 4.17 6 2431.50 0.00 1761956 73200 0.45 0.00 0.00 0.00 0 oniux
# Time UID PID %usr %system %guest %wait %CPU CPU minflt/s majflt/s VSZ RSS %MEM kB_rd/s kB_wr/s kB_ccwr/s iodelay Command
1762263423 1000 165478 98.50 1.50 0.00 0.00 4.17 6 76.50 0.00 1761956 73776 0.45 0.00 0.00 0.00 0 oniux
# Time UID PID %usr %system %guest %wait %CPU CPU minflt/s majflt/s VSZ RSS %MEM kB_rd/s kB_wr/s kB_ccwr/s iodelay Command
1762263425 1000 165478 99.00 1.00 0.00 0.00 4.17 6 44.50 0.00 1761956 73968 0.45 0.00 0.00 0.00 0 oniux
# Time UID PID %usr %system %guest %wait %CPU CPU minflt/s majflt/s VSZ RSS %MEM kB_rd/s kB_wr/s kB_ccwr/s iodelay Command
1762263427 1000 165478 99.00 1.00 0.00 0.00 4.17 6 40.00 0.00 1761956 74352 0.46 0.00 0.00 0.00 0 oniux
# Time UID PID %usr %system %guest %wait %CPU CPU minflt/s majflt/s VSZ RSS %MEM kB_rd/s kB_wr/s kB_ccwr/s iodelay Command
1762263429 1000 165478 99.00 1.00 0.00 0.00 4.17 6 42.50 0.00 1761956 74736 0.46 0.00 0.00 0.00 0 oniux
# Time UID PID %usr %system %guest %wait %CPU CPU minflt/s majflt/s VSZ RSS %MEM kB_rd/s kB_wr/s kB_ccwr/s iodelay Command
1762263431 1000 165478 98.50 1.50 0.00 0.00 4.16 6 51.00 0.00 1761296 74380 0.46 0.00 0.00 0.00 0 oniux
# Time UID PID %usr %system %guest %wait %CPU CPU minflt/s majflt/s VSZ RSS %MEM kB_rd/s kB_wr/s kB_ccwr/s iodelay Command
1762263433 1000 165478 99.00 1.00 0.00 0.00 4.17 6 38.50 0.00 1761296 74764 0.46 0.00 0.00 0.00 0 oniux
# Time UID PID %usr %system %guest %wait %CPU CPU minflt/s majflt/s VSZ RSS %MEM kB_rd/s kB_wr/s kB_ccwr/s iodelay Command
1762263435 1000 165478 105.00 1.50 0.00 0.00 4.44 6 249.50 0.00 1764172 79040 0.48 0.00 0.00 0.00 0 oniux
# Time UID PID %usr %system %guest %wait %CPU CPU minflt/s majflt/s VSZ RSS %MEM kB_rd/s kB_wr/s kB_ccwr/s iodelay Command
1762263437 1000 165478 271.50 1.00 0.00 0.00 11.36 6 318.00 0.00 1765464 81536 0.50 0.00 0.00 0.00 0 oniux
# Time UID PID %usr %system %guest %wait %CPU CPU minflt/s majflt/s VSZ RSS %MEM kB_rd/s kB_wr/s kB_ccwr/s iodelay Command
1762263439 1000 165478 99.50 1.50 0.00 0.00 4.21 6 327.00 0.00 1762220 82900 0.51 0.00 12.00 0.00 0 oniux
45.84.107.198
1 Linux 6.6.87.2-microsoft-standard-WSL2 (PrincessPi-Desk) 11/04/2025 _x86_64_ (24 CPU)
2 # Time UID PID %usr %system %guest %wait %CPU CPU minflt/s majflt/s VSZ RSS %MEM kB_rd/s kB_wr/s kB_ccwr/s iodelay Command
3 1762263417 1000 165478 98.50 1.00 0.00 0.00 4.15 6 995.00 0.00 1762980 38400 0.24 0.00 8.00 0.00 0 oniux
4 # Time UID PID %usr %system %guest %wait %CPU CPU minflt/s majflt/s VSZ RSS %MEM kB_rd/s kB_wr/s kB_ccwr/s iodelay Command
5 1762263419 1000 165478 98.00 1.50 0.00 0.00 4.15 6 976.50 0.00 1759736 47472 0.29 0.00 12.00 0.00 0 oniux
6 # Time UID PID %usr %system %guest %wait %CPU CPU minflt/s majflt/s VSZ RSS %MEM kB_rd/s kB_wr/s kB_ccwr/s iodelay Command
7 1762263421 1000 165478 96.50 3.50 0.00 0.00 4.17 6 2431.50 0.00 1761956 73200 0.45 0.00 0.00 0.00 0 oniux
8 # Time UID PID %usr %system %guest %wait %CPU CPU minflt/s majflt/s VSZ RSS %MEM kB_rd/s kB_wr/s kB_ccwr/s iodelay Command
9 1762263423 1000 165478 98.50 1.50 0.00 0.00 4.17 6 76.50 0.00 1761956 73776 0.45 0.00 0.00 0.00 0 oniux
10 # Time UID PID %usr %system %guest %wait %CPU CPU minflt/s majflt/s VSZ RSS %MEM kB_rd/s kB_wr/s kB_ccwr/s iodelay Command
11 1762263425 1000 165478 99.00 1.00 0.00 0.00 4.17 6 44.50 0.00 1761956 73968 0.45 0.00 0.00 0.00 0 oniux
12 # Time UID PID %usr %system %guest %wait %CPU CPU minflt/s majflt/s VSZ RSS %MEM kB_rd/s kB_wr/s kB_ccwr/s iodelay Command
13 1762263427 1000 165478 99.00 1.00 0.00 0.00 4.17 6 40.00 0.00 1761956 74352 0.46 0.00 0.00 0.00 0 oniux
14 # Time UID PID %usr %system %guest %wait %CPU CPU minflt/s majflt/s VSZ RSS %MEM kB_rd/s kB_wr/s kB_ccwr/s iodelay Command
15 1762263429 1000 165478 99.00 1.00 0.00 0.00 4.17 6 42.50 0.00 1761956 74736 0.46 0.00 0.00 0.00 0 oniux
16 # Time UID PID %usr %system %guest %wait %CPU CPU minflt/s majflt/s VSZ RSS %MEM kB_rd/s kB_wr/s kB_ccwr/s iodelay Command
17 1762263431 1000 165478 98.50 1.50 0.00 0.00 4.16 6 51.00 0.00 1761296 74380 0.46 0.00 0.00 0.00 0 oniux
18 # Time UID PID %usr %system %guest %wait %CPU CPU minflt/s majflt/s VSZ RSS %MEM kB_rd/s kB_wr/s kB_ccwr/s iodelay Command
19 1762263433 1000 165478 99.00 1.00 0.00 0.00 4.17 6 38.50 0.00 1761296 74764 0.46 0.00 0.00 0.00 0 oniux
20 # Time UID PID %usr %system %guest %wait %CPU CPU minflt/s majflt/s VSZ RSS %MEM kB_rd/s kB_wr/s kB_ccwr/s iodelay Command
21 1762263435 1000 165478 105.00 1.50 0.00 0.00 4.44 6 249.50 0.00 1764172 79040 0.48 0.00 0.00 0.00 0 oniux
22 # Time UID PID %usr %system %guest %wait %CPU CPU minflt/s majflt/s VSZ RSS %MEM kB_rd/s kB_wr/s kB_ccwr/s iodelay Command
23 1762263437 1000 165478 271.50 1.00 0.00 0.00 11.36 6 318.00 0.00 1765464 81536 0.50 0.00 0.00 0.00 0 oniux
24 # Time UID PID %usr %system %guest %wait %CPU CPU minflt/s majflt/s VSZ RSS %MEM kB_rd/s kB_wr/s kB_ccwr/s iodelay Command
25 1762263439 1000 165478 99.50 1.50 0.00 0.00 4.21 6 327.00 0.00 1762220 82900 0.51 0.00 12.00 0.00 0 oniux
26 45.84.107.198