(
State(state): State<AppState>,
Json(payload): Json<ClientStreamStats>,
)
| 1601 | } |
| 1602 | |
| 1603 | async fn record_client_stream_stats( |
| 1604 | State(state): State<AppState>, |
| 1605 | Json(payload): Json<ClientStreamStats>, |
| 1606 | ) -> Result<Json<Value>, AppError> { |
| 1607 | if payload.client_id.trim().is_empty() || payload.kind.trim().is_empty() { |
| 1608 | return Err(AppError::bad_request( |
| 1609 | "Request body must include `clientId` and `kind`.", |
| 1610 | )); |
| 1611 | } |
| 1612 | |
| 1613 | apply_stream_client_foreground_from_stats(&state, &payload); |
| 1614 | state.metrics.record_client_stream_stats(payload); |
| 1615 | Ok(json(json_value!({ "ok": true }))) |
| 1616 | } |
| 1617 | |
| 1618 | pub(crate) fn apply_stream_client_foreground_from_stats( |
| 1619 | state: &AppState, |
nothing calls this directly
no test coverage detected