API v 1.2
JavaScript

Statistics

The Ably service retains usage statistics per application and per account at 1 minute intervals. Your application statistics are available programmatically through our client libraries at 1 minute intervals, or aggregated up to the hour, day, or month.

 Tip

Your most recent statistics are delayed by up to 6 seconds.

Your application and account statistics are also available as graphs, tabular data or downloads in your application dashboard.

The Ably service aggregates your application statistics by minute, hour, day and month, both at an application level and at an account level. Account level statistics are not available via the client library APIs and must be viewed using your account dashboard. Your monthly quota and any potential overages are calculated using the account level statistics. Find out what happens if you exceed your package limits.

The Ably REST client library provides a straightforward API for retrieving application statistics:

JavaScript
var rest = new Ably.Rest('<loading API key, please wait>'); rest.stats({ unit: 'hour' }, function(err, resultPage) { var thisHour = resultPage.items[0]; console.log(thisHour); // => {all: a, inbound: f, outbound: f, …} });
Demo Only
Copied!

View the Statistics API Reference.