fix: JSONL parsing in run_batch, add results/ to gitignore
This commit is contained in:
parent
c839230c0b
commit
e53b2c7e4c
@ -62,8 +62,8 @@ get_conc_for() {
|
||||
local isl="$1"
|
||||
if (( isl <= 4096 )); then echo "1 2 4 8 16 32 64 128"
|
||||
elif (( isl <= 16384 )); then echo "1 2 4 8 16 32"
|
||||
elif (( isl <= 65536 )); then echo "1 2 4 8 16"
|
||||
else echo "1 2 4 8"
|
||||
elif (( isl <= 65536 )); then echo "1 2 4 8"
|
||||
else echo "1 2 4"
|
||||
fi
|
||||
}
|
||||
|
||||
@ -107,11 +107,27 @@ run_one() {
|
||||
log " FAIL isl=${isl} osl=${osl} c=${conc} rc=${rc}"; return 1
|
||||
fi
|
||||
|
||||
# Extract metrics
|
||||
local tps=$(python3 -c "import json;d=json.load(open('${out}'));print(round(d.get('tps',-1),1))" 2>/dev/null || echo "-1")
|
||||
local ttft=$(python3 -c "import json;d=json.load(open('${out}'));print(round(d.get('ttft_mean',-1),1))" 2>/dev/null || echo "-1")
|
||||
local tpot=$(python3 -c "import json;d=json.load(open('${out}'));print(round(d.get('tpot_mean',-1),1))" 2>/dev/null || echo "-1")
|
||||
local e2e=$(python3 -c "import json;d=json.load(open('${out}'));print(round(d.get('e2e_latency_mean',-1),1))" 2>/dev/null || echo "-1")
|
||||
# Extract metrics (JSONL: first line has aggregate summary)
|
||||
local metrics=$(python3 -c "
|
||||
import json
|
||||
for line in open('${out}'):
|
||||
line=line.strip()
|
||||
if not line: continue
|
||||
try:
|
||||
d=json.loads(line)
|
||||
tps=d.get('total_throughput',d.get('tps',-1))
|
||||
ttft=d.get('mean_ttft_ms',d.get('ttft_mean',-1))
|
||||
tpot=d.get('mean_tpot_ms',d.get('tpot_mean',-1))
|
||||
e2e=d.get('mean_e2e_latency_ms',d.get('e2e_latency_mean',-1))
|
||||
if tps!=-1 or ttft!=-1:
|
||||
print(f'{round(tps,1)},{round(ttft,1)},{round(tpot,1)},{round(e2e,1)}')
|
||||
break
|
||||
except: pass
|
||||
" 2>/dev/null || echo "-1,-1,-1,-1")
|
||||
local tps=$(echo "$metrics" | cut -d, -f1)
|
||||
local ttft=$(echo "$metrics" | cut -d, -f2)
|
||||
local tpot=$(echo "$metrics" | cut -d, -f3)
|
||||
local e2e=$(echo "$metrics" | cut -d, -f4)
|
||||
|
||||
echo "${isl},${osl},${conc},${tps},${ttft},${tpot},${e2e},${slo_ms},OK,${elapsed}" >> "$SUMMARY_FILE"
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user