Use the ably stats account command to get account-level statistics with optional live updates.
Synopsis
ably stats account [options]Options
--start
The start of the time range to retrieve stats from. Accepts ISO 8601, Unix milliseconds, or relative time formats.
--end
The end of the time range to retrieve stats from. Accepts ISO 8601, Unix milliseconds, or relative time formats.
--unit
The unit of time for the stats interval. Options are minute, hour, day, or month. Defaults to minute.
--limit
The maximum number of stats records to retrieve. Defaults to 10.
--live
Subscribe to live stats updates at minute intervals. Defaults to false.
--interval
The polling interval in seconds for live mode. Defaults to 6.
--debug
Show debug information for live polling. Defaults to false.
--json
Output results as compact JSON. Mutually exclusive with --pretty-json.
--pretty-json
Output results in formatted JSON. Mutually exclusive with --json.
--verbose | -v
Enable verbose logging. Can be combined with --json or --pretty-json.
Examples
Retrieve recent account stats:
ably stats accountRetrieve hourly stats:
ably stats account --unit hourRetrieve stats within a time range:
ably stats account --start "2025-01-01T00:00:00Z" --end "2025-01-02T00:00:00Z"Subscribe to live stats updates:
ably stats account --liveSubscribe to live stats with a custom polling interval:
ably stats account --live --interval 10Retrieve account stats from the last hour using relative time:
ably stats account --start 1hRetrieve a limited number of account stats entries:
ably stats account --limit 10Retrieve account stats in JSON format:
ably stats account --jsonRetrieve account stats in formatted JSON output:
ably stats account --pretty-jsonOutput
The ably accounts stats command displays statistics for each time period:
| Metric | Description |
|---|---|
| Connections | Peak, minimum, mean connections, plus opened, refused, and active counts |
| Channels | Peak, minimum, mean channels, plus opened, refused, and active counts |
| Messages | Total, published, delivered message counts and data volume |
| API Requests | Succeeded, failed, refused, and total request counts |
| Token Requests | Succeeded, failed, and refused token request counts |
| Peak Rates | Maximum rates per second for messages, connections, channels, API requests, and token requests |
See also
- Stats — Explore all
ably statscommands. - CLI reference — Full list of available commands.