HEL-910: real-call retest window record — web text interrupt, wait chain, budgets, cleanup evidence
Co-authored-by: multica-agent <github@multica.ai>
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
#!/usr/bin/env bash
|
||||
# HEL-910:用量账快查(LLM 请求/tokens、TTS 段数、ASR 账本)——触线即停的现场读数
|
||||
set -u
|
||||
BASE=/opt/cybergril-hel910
|
||||
echo "== budget tables ($(date -u +%FT%TZ)) =="
|
||||
python3 - <<'EOF'
|
||||
import json, sqlite3, pathlib
|
||||
db = '/opt/cybergril-hel910/data/companion.db'
|
||||
try:
|
||||
conn = sqlite3.connect(f'file:{db}?mode=ro', uri=True); conn.row_factory = sqlite3.Row
|
||||
for sql, label in [
|
||||
("SELECT key,value FROM budget_total", 'budget_total'),
|
||||
("SELECT day,scene,used FROM token_usage ORDER BY day,scene", 'token_usage'),
|
||||
("SELECT * FROM request_usage", 'request_usage'),
|
||||
]:
|
||||
try:
|
||||
print(label, json.dumps([dict(r) for r in conn.execute(sql)], ensure_ascii=False))
|
||||
except Exception as e:
|
||||
print(label, 'ERR', e)
|
||||
conn.close()
|
||||
except Exception as e:
|
||||
print('db ERR', e)
|
||||
p = pathlib.Path('/opt/cybergril-hel910/asr-usage.jsonl')
|
||||
if p.exists():
|
||||
lines = [l for l in p.read_text().splitlines() if l.strip()]
|
||||
print('asr ledger events:', len(lines))
|
||||
else:
|
||||
print('asr ledger: (none)')
|
||||
EOF
|
||||
echo "== tts.log window segments =="
|
||||
T0MARK=$BASE/snapshots/tts-log-start-byte
|
||||
if [ -f "$T0MARK" ]; then
|
||||
START=$(cat "$T0MARK")
|
||||
else
|
||||
START=0
|
||||
fi
|
||||
tail -c +$((START + 1)) /opt/voice-agent/cosyvoice/tts.log 2>/dev/null | grep -c "first chunk" || true
|
||||
echo "(syntheses reaching first chunk since window start; cap 20)"
|
||||
Reference in New Issue
Block a user