palbaseDocs

Palbase Realtime · API

GET/realtime/stats

Read the realtime stats

The project's realtime, measured — for its charts.

now is what it holds this moment: every replica is asked when this is read and all must answer; a replica that is alive and silent (one that just died, for up to 15 seconds) makes it a 503 to retry, never a smaller number.

rows are the window's buckets (UTC hours, or days), from what realtime measured as it ran: each replica counts in memory and adds its counts to the hour once a minute — a replica that dies loses at most its last minute — and the leader counts every replica's sockets once a minute for the peak. peak_connections is a gauge; messages_delivered, broadcasts, presence_joins, presence_leaves, connections_opened and connections_refused are counters. Hours are kept 91 days, then forgotten; they go with the project.

limits.connections is the connection limit in force, for a limit line.

Called by your server, with the project's secret key.

Query

window_secondsinteger · optionalHow far back the rows reach, in seconds: 1 to 7776000 (90 days); a day when absent.
bucket"hour" | "day" · optionalThe rows' bucket: hour or day. Absent: hour up to a window of two days, day beyond.
curl
curl -X GET "https://<your-ref>.palbase.studio/realtime/stats" \
  -H "apikey: $PALBASE_SECRET_KEY"

Responses

200The project's realtime, measured

400The request is malformed: a field, a channel or a pattern is wrong

401No key, or not a key of this project, or a token that is not valid (the edge's answer)

403Not the project's secret key

429The project's request rate, its realtime quota for the period, or the connections it allows are used up; Retry-After says when to try again

503The platform could not answer now; retrying is safe (Retry-After)

defaultAn error: the envelope names it (`error`) and explains it (`error_description`).

Operation GetStats of realtime's contract.