This commit is contained in:
ed
2019-05-30 13:17:45 +00:00
parent 250d0bdf57
commit df276b6a84
3 changed files with 160 additions and 21 deletions

View File

@@ -33,3 +33,10 @@ para() { for s in 1 2 3 4 5 6 7 8 12 16 24 32 48 64; do echo $s; for r in {1..4}
## usage: avg logfile
avg() { awk 'function pr(ncsz) {if (nsmp>0) {printf "%3s %s\n", csz, sum/nsmp} csz=$1;sum=0;nsmp=0} {sub(/\r$/,"")} /^[0-9]+$/ {pr($1);next} / MiB/ {sub(/ MiB.*/,"");sub(/.* /,"");sum+=$1;nsmp++} END {pr(0)}' "$1"; }
##
## vscode
# replace variable name
# (^|[^\w])oldname([^\w]|$) => $1newname$2