def reports_to_flush
      # The Redis rename command overwrites the key with the new name if it
      # exists. This means that if the rename operation fails in a flush cycle,
      # and succeeds in a next one, the data that the key had in the first
      # flush cycle will be lost.
      # For that reason, every time we need to rename a key, we will use a
      # unique suffix. This way, when the rename operation fails, the key
      # will not be overwritten later, and we will be able to recover its
      # content.
      suffix = suffix_for_unique_naming

      report_keys = report_keys_to_flush(suffix)
      if report_keys.empty?
        logger.warn "No reports available to flush"
        report_keys
      else
        reports(report_keys, suffix)
      end
    end
def reports_to_flush
      # The Redis rename command overwrites the key with the new name if it
      # exists. This means that if the rename operation fails in a flush cycle,
      # and succeeds in a next one, the data that the key had in the first
      # flush cycle will be lost.
      # For that reason, every time we need to rename a key, we will use a
      # unique suffix. This way, when the rename operation fails, the key
      # will not be overwritten later, and we will be able to recover its
      # content.
      suffix = suffix_for_unique_naming

      report_keys = report_keys_to_flush(suffix)
      if report_keys.empty?
        logger.warn "No reports available to flush"
        report_keys
      else
        reports(report_keys, suffix)
      end
    end
This performs a cleanup of the reports to be flushed.
 We can decide later whether it is better to leave this responsibility
 to the caller of the method.

 Returns an array of hashes where each of them has a service_id,
 credentials, and a usage. The usage is another hash where the keys are
 the metrics and the values are guaranteed to respond to to_i and to_s.