feat(ai-service): 摄像头流抽帧检测骨架与监控指标(#23/#26)

This commit is contained in:
weijuesen
2026-08-13 15:55:17 +08:00
parent 5b88ed2618
commit 156b670b3d
3 changed files with 99 additions and 1 deletions
+13
View File
@@ -40,3 +40,16 @@ def test_detect_empty_file_rejected():
def test_detect_invalid_image_rejected():
r = client.post("/detect", files={"file": ("a.png", b"junk", "image/png")})
assert r.status_code == 400
def test_stream_detect_missing_url():
r = client.post("/stream-detect", json={})
assert r.status_code == 400
def test_metrics_shape():
r = client.get("/metrics")
assert r.status_code == 200
body = r.json()
for key in ("model", "uptimeSeconds", "requests", "avgLatencyMs", "gpu"):
assert key in body