Track observed node throughput

This commit is contained in:
Dobromir Popov
2026-07-02 23:28:20 +02:00
parent a938c19a82
commit 83b042d94b
6 changed files with 322 additions and 14 deletions

View File

@@ -262,6 +262,11 @@ def test_proxy_chat_bills_client_and_credits_node(billed_tracker):
assert summary["node_pending"]["wallet-head"] == pytest.approx(0.02 * 0.90)
assert summary["protocol_cut"] == pytest.approx(0.02 * 0.10)
stats = json.loads(urllib.request.urlopen(f"{tracker_url}/v1/stats").read())
node_stats = next(iter(stats["nodes"].values()))["models"][MODEL]
assert node_stats["tokens_per_sec_last_hour"] is not None
assert node_stats["sample_count_last_hour"] == 1
def test_proxy_chat_402_when_balance_exhausted(billed_tracker):
tracker_url, ledger = billed_tracker