MCPcopy Create free account
hub / github.com/NativeScript/SimDeck / record_client_stream_stats

Function record_client_stream_stats

packages/server/src/api/routes.rs:1603–1616  ·  view source on GitHub ↗
(
    State(state): State<AppState>,
    Json(payload): Json<ClientStreamStats>,
)

Source from the content-addressed store, hash-verified

1601}
1602
1603async 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
1618pub(crate) fn apply_stream_client_foreground_from_stats(
1619 state: &AppState,

Callers

nothing calls this directly

Calls 4

jsonFunction · 0.85
is_emptyMethod · 0.80

Tested by

no test coverage detected