+ kqlsh "$@" -e "CONSISTENCY LOCAL_ONE; PAGING 100; SELECT * FROM \"$ks\".\"$tb\" LIMIT 30000;" | grep -v '\[json\]\|rows)\|-----\|^$' | tr -d ' ' | awk -v keyspace=$ks -v table=$tb -v blob_factor=$blob_factor -v ttl_factor=$ttl_factor -v frozen_factor=$frozen_factor -v static_factor=$static_factor -F'|' 'BEGIN {columns=0; numSamples=30000; kilobyte=1024; min = "NaN"; max = -1; lines = 1; } { if(NR==3){columns=NF;} if(NR>2){thislen=(length($0))+100+6+(columns*2); total+=thislen; squares+=thislen^2; lines+=1; avg=total/lines; min = (thislen<min ? thislen : min); max = (thislen>max ? thislen : max) }} NR==numSamples {exit} END { printf("%s.%s = { lines: %d, columns: %d, average: %d bytes, stdev: %d bytes, min: %d bytes, max: %d bytes, blob: %s, default-ttl: %s, static: %s}\n", keyspace, table, lines, columns, avg, sqrt(squares/lines - (avg^2)), min, max, blob_factor, ttl_factor, static_factor); }'
0 commit comments