Files
app-flutter/tool/linktest_summary.py
T
mikkeli 6a91909945
CI / Analyze & Test (push) Successful in 9s
CI / Debug APK (push) Successful in 16s
Link test: optional @host on the launch hook; summary script for the Orin's results
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DDwfd6Ki8UfG4hK6W5YpJz
2026-10-11 15:58:43 +09:00

33 lines
1.3 KiB
Python

#!/usr/bin/env python3
"""Tabulate link-test runs from the Orin's results file: python3 linktest_summary.py [results.jsonl] [label...]"""
import json
import os
import sys
path = os.path.expanduser(sys.argv[1] if len(sys.argv) > 1 else "~/linktest/results.jsonl")
labels = sys.argv[2:]
runs = {}
for line in open(path):
r = json.loads(line)
if "id" in r:
runs.setdefault(r["id"], []).append(r)
for run_id, recs in runs.items():
if labels and not any(run_id.startswith(l + "-") for l in labels):
continue
print(f"\n== {run_id}")
for r in recs:
k = r["kind"]
if k in ("udp", "soak"):
print(f" {k:5} {r['size']:>4} B {r['rate']:>3}/s {r['secs']:>2}s loss {r['loss_pct']:>5}% "
f"rtt p50 {r['rtt_p50_ms']:>6} p99 {r['rtt_p99_ms']:>7} max {r['rtt_max_ms']:>7} ms "
f"gap {r['max_gap_ms']:>7} ms sendfail {r['send_fails']}")
elif k in ("tcp_down", "tcp_up"):
print(f" {k:8} {r['mb_s']:>6} MB/s over {r['secs']} s")
elif k in ("tcp_down_orin", "tcp_up_orin"):
print(f" {k:13} retrans {r.get('retrans')} rtt {r.get('rtt_ms')} ms rto {r.get('rto_ms')} ms {r.get('error', '')}")
elif k == "error":
print(f" ERROR {r['error']}")
elif k == "end":
print(" (complete)")