code: def get_stats_action(cachespec, interval):
      
      if cachespec == 'global':
          caches = get_bcache_fs()
      else:
          caches = [Bcache.fromdevice(cachespec)]
      res = dict((c.cachepath, c.get_stats(interval)) for c in caches)
      return json.dumps(res, indent=4, separators=(',', ': '))
docs: Action for getting bcache statistics for a given cachespec.
      Cachespec can either be a device name, eg. 'sdb', which will retrieve
      cache stats for the given device, or 'global', which will retrieve stats
      for all cachesets