'Update volume statistics.'

def _update_volume_stats(self):

    LOG.debug('Updating    volume    stats.')
    data = dict()
    data['volume_backend_name'] = self._backend_name
    data['vendor_name'] = 'NetApp'
    data['driver_version'] = self.VERSION
    data['storage_protocol'] = self.driver_protocol
    data['pools'] = []
    for storage_pool in self._get_storage_pools():
        cinder_pool = {}
        cinder_pool['pool_name'] = storage_pool.get('label')
        cinder_pool['QoS_support'] = False
        cinder_pool['reserved_percentage'] = self.configuration.reserved_percentage
        cinder_pool['max_over_subscription_ratio'] = self.configuration.max_over_subscription_ratio
        tot_bytes = int(storage_pool.get('totalRaidedSpace', 0))
        used_bytes = int(storage_pool.get('usedSpace', 0))
        cinder_pool['provisioned_capacity_gb'] = (used_bytes / units.Gi)
        cinder_pool['free_capacity_gb'] = ((tot_bytes - used_bytes) / units.Gi)
        cinder_pool['total_capacity_gb'] = (tot_bytes / units.Gi)
        pool_ssc_stats = self._ssc_stats.get(storage_pool['volumeGroupRef'])
        if pool_ssc_stats:
            thin = (pool_ssc_stats.get(self.THIN_UQ_SPEC) or False)
            cinder_pool.update(pool_ssc_stats)
        else:
            thin = False
        cinder_pool['thin_provisioning_support'] = thin
        cinder_pool['thick_provisioning_support'] = True
        data['pools'].append(cinder_pool)
    self._stats = data
    self._garbage_collect_tmp_vols()
