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
This commit is contained in:
@@ -22,7 +22,7 @@ import io.flutter.plugin.common.MethodChannel
|
||||
* When asked, the whole process is bound to the Ethernet (NCM) network while it
|
||||
* exists, and unbound when it goes.
|
||||
*
|
||||
* Also a development hook: `am start -n dev.yukart.display/.MainActivity --es linktest <label>`
|
||||
* Also a development hook: `am start -n dev.yukart.display/.MainActivity --es linktest <label>[@<host>]`
|
||||
* runs the link test (lib/linktest.dart) without touching the screen.
|
||||
*/
|
||||
class MainActivity : FlutterActivity() {
|
||||
|
||||
+7
-3
@@ -18,10 +18,14 @@ Future<void> main() async {
|
||||
await usb.bindFor(Uri.parse(defaultUrl));
|
||||
final boundary = Boundary(defaultUrl)..start();
|
||||
final linkTest = LinkTest(usb);
|
||||
// Development hook: `am start ... --es linktest <label>` runs the test on the gateway's host.
|
||||
Future<void> runLinkTest(String label) async {
|
||||
// Development hook: `am start ... --es linktest <label>[@<host>]` runs the test,
|
||||
// on the gateway's host unless one is given.
|
||||
Future<void> runLinkTest(String request) async {
|
||||
final at = request.indexOf('@');
|
||||
final label = at < 0 ? request : request.substring(0, at);
|
||||
final host = at < 0 ? Uri.parse(boundary.url).host : request.substring(at + 1);
|
||||
navigatorKey.currentState?.push(MaterialPageRoute<void>(builder: (_) => linkTestPage(boundary, linkTest, usb)));
|
||||
await linkTest.run(Uri.parse(boundary.url).host, label);
|
||||
await linkTest.run(host, label);
|
||||
await usb.bindFor(Uri.parse(boundary.url));
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
#!/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)")
|
||||
Reference in New Issue
Block a user