How is the 'peakRates' account stat defined?

What are the different peakRate stats?

There are a number of different peakRate stats, which take similar meanings to the equivalent stat in the by-minute/hour/day/month stats. For example, `peakRates.messages` is the total number of messages, inbound and outbound, sent in that account.

How are they measured?

The peak rate at any particular moment is measured as a rolling average of a 24-second window.

The peakrate as reported in the persisted minute-by-minute stats is the maximum value that that 24-second-moving-average reached at any point in that minute.

Why is it defined this way? What does it add over the per-minute stats?

The 24s moving average was chosen for use in our global instantaneous rate limits. See https://ably.com/blog/distributed-rate-limiting-scale-your-platform for more explanation on why this was implemented this way.

These peakRate are then exposed to customers in the account statistics so that they can see how close they are to hitting the instaneous rate limits, which may not always be obvious from the normal minute-by-minute stats, especially for spiky publish patterns.