'Updates the volume usage cache table with a list of stats.'

def _update_volume_usage_cache(self, context, vol_usages):

    for usage in vol_usages:
        greenthread.sleep(0)
        vol_usage = objects.VolumeUsage(context)
        vol_usage.volume_id = usage['volume']
        vol_usage.instance_uuid = usage['instance'].uuid
        vol_usage.project_id = usage['instance'].project_id
        vol_usage.user_id = usage['instance'].user_id
        vol_usage.availability_zone = usage['instance'].availability_zone
        vol_usage.curr_reads = usage['rd_req']
        vol_usage.curr_read_bytes = usage['rd_bytes']
        vol_usage.curr_writes = usage['wr_req']
        vol_usage.curr_write_bytes = usage['wr_bytes']
        vol_usage.save()
        self.notifier.info(context, 'volume.usage', compute_utils.usage_volume_info(vol_usage))
