class Fastly

def usage(opts)

See http://docs.fastly.com/docs/stats for details.

region:: restrict query to a particular region
by:: the sampling rate used to produce the result set (minute, hour, day)
to:: latest time from which to fetch historical statistics
from:: earliest time from which to fetch historical statistics

Other options available are:

If the :by_service flag is passed then returns usage information aggregated by service and grouped by service & region.

If the :by_month flag is passed then returns total usage information aggregated by month as well as grouped by service & region.

Returns usage information aggregated across all Fastly services and grouped by region.
def usage(opts)
  url  = '/stats/usage'
  url += '_by_month' if opts.delete(:by_month)
  url += '_by_service' if opts.delete(:by_service)
  client.get_stats(url, opts)
end