Skip to main content

stats_handler

Function stats_handler 

Source
pub async fn stats_handler<A: DatabaseAdapter>(
    __arg0: State<AppState<A>>,
) -> Result<Json<ApiResponse<StatsResponse>>, ApiError>
Expand description

Get query execution statistics.

Returns aggregated metrics from query executions, read from the in-process atomic counters that the GraphQL handler updates on every request:

  • Total queries executed
  • Successful vs failed counts
  • Average latency in milliseconds (computed from cumulative microseconds)

Counters reset to zero on server restart (they are not persisted).

ยงErrors

This handler is infallible.