bump v0.90.0
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
#!/usr/bin/env python3
|
||||
import sqlite3, json
|
||||
db = sqlite3.connect("/opt/elmer/elmer.db")
|
||||
for sid in [41, 40]:
|
||||
r = db.execute("SELECT id, created_at, raw_responses FROM sessions WHERE id=?", (sid,)).fetchone()
|
||||
print(f"\n=== SESSION #{r[0]} {r[1]} ===")
|
||||
if not r[2]: print(" (no raw data)"); continue
|
||||
data = json.loads(r[2])
|
||||
print(f" Total responses: {len(data)}")
|
||||
cmds = {}
|
||||
for d in data:
|
||||
c = d.get("cmd","?")
|
||||
s = d.get("step_id","?")
|
||||
raw = d.get("raw","")
|
||||
dec = d.get("decoded","")
|
||||
key = f"{s} ({c})"
|
||||
if key not in cmds:
|
||||
cmds[key] = {"cnt": 0, "err": 0, "empty": 0, "ok": 0, "samples": []}
|
||||
cmds[key]["cnt"] += 1
|
||||
if not raw or raw in ["?","(err)","NO DATA"]:
|
||||
cmds[key]["err"] += 1
|
||||
elif raw == "":
|
||||
cmds[key]["empty"] += 1
|
||||
else:
|
||||
cmds[key]["ok"] += 1
|
||||
if len(cmds[key]["samples"]) < 2:
|
||||
cmds[key]["samples"].append(f"{raw} -> {dec}")
|
||||
for k, v in sorted(cmds.items()):
|
||||
print(f" {k:30s} total={v['cnt']:3d} ok={v['ok']} err={v['err']} empty={v['empty']}")
|
||||
for s in v["samples"]:
|
||||
print(f" {s}")
|
||||
db.close()
|
||||
Reference in New Issue
Block a user