diff --git a/api/perf_routes.py b/api/perf_routes.py index e5bcac2..bbf4a12 100644 --- a/api/perf_routes.py +++ b/api/perf_routes.py @@ -1,7 +1,7 @@ """Frontend performance metrics ingestion endpoint.""" from __future__ import annotations -from fastapi import APIRouter +from fastapi import APIRouter, Response from pydantic import BaseModel, Field, field_validator import api.metrics as app_metrics @@ -26,8 +26,8 @@ class PerfSample(BaseModel): perf_router = APIRouter(tags=["perf"]) -@perf_router.post("/api/perf", status_code=204) -async def record_perf(samples: list[PerfSample]) -> None: +@perf_router.post("/api/perf") +async def record_perf(samples: list[PerfSample]) -> Response: if len(samples) > MAX_BATCH_SIZE: samples = samples[:MAX_BATCH_SIZE] @@ -41,3 +41,5 @@ async def record_perf(samples: list[PerfSample]) -> None: app_metrics.frontend_main_thread.record(s.value, attrs) elif s.metric == "feature_count": app_metrics.frontend_feature_count.record(s.value) + + return Response(status_code=204)