'Retrieve stats info.'

def update_volume_stats(self):

    pools = []
    arrays = {}
    wlp_enabled = False
    total_capacity_gb = 0
    free_capacity_gb = 0
    provisioned_capacity_gb = 0
    location_info = None
    backend_name = self.pool_info['backend_name']
    max_oversubscription_ratio = self.pool_info['max_over_subscription_ratio']
    reserved_percentage = self.pool_info['reserved_percentage']
    array_reserve_percent = None
    array_info_list = self.pool_info['arrays_info']
    already_queried = False
    for array_info in array_info_list:
        if self.failover:
            array_info = self.get_secondary_stats_info(self.rep_config, array_info)
        self.rest.set_rest_credentials(array_info)
        if (array_info['SerialNumber'] not in arrays):
            (location_info, total_capacity_gb, free_capacity_gb, provisioned_capacity_gb, array_reserve_percent, wlp_enabled) = self._update_srp_stats(array_info)
        else:
            already_queried = True
        pool_name = ('%(slo)s+%(workload)s+%(srpName)s+%(array)s' % {'slo': array_info['SLO'], 'workload': array_info['Workload'], 'srpName': array_info['srpName'], 'array': array_info['SerialNumber']})
        if (wlp_enabled is False):
            arrays[array_info['SerialNumber']] = [total_capacity_gb, free_capacity_gb, provisioned_capacity_gb, array_reserve_percent]
        if already_queried:
            temp_location_info = ('%(arrayName)s#%(srpName)s#%(slo)s#%(workload)s' % {'arrayName': array_info['SerialNumber'], 'srpName': array_info['srpName'], 'slo': array_info['SLO'], 'workload': array_info['Workload']})
            pool = {'pool_name': pool_name, 'total_capacity_gb': arrays[array_info['SerialNumber']][0], 'free_capacity_gb': arrays[array_info['SerialNumber']][1], 'provisioned_capacity_gb': arrays[array_info['SerialNumber']][2], 'QoS_support': False, 'location_info': temp_location_info, 'thin_provisioning_support': True, 'thick_provisioning_support': False, 'consistent_group_snapshot_enabled': True, 'max_over_subscription_ratio': max_oversubscription_ratio, 'reserved_percentage': reserved_percentage, 'replication_enabled': self.replication_enabled}
            if arrays[array_info['SerialNumber']][3]:
                if reserved_percentage:
                    if (arrays[array_info['SerialNumber']][3] > reserved_percentage):
                        pool['reserved_percentage'] = arrays[array_info['SerialNumber']][3]
                else:
                    pool['reserved_percentage'] = arrays[array_info['SerialNumber']][3]
        else:
            pool = {'pool_name': pool_name, 'total_capacity_gb': total_capacity_gb, 'free_capacity_gb': free_capacity_gb, 'provisioned_capacity_gb': provisioned_capacity_gb, 'QoS_support': False, 'location_info': location_info, 'consistencygroup_support': False, 'thin_provisioning_support': True, 'thick_provisioning_support': False, 'consistent_group_snapshot_enabled': True, 'max_over_subscription_ratio': max_oversubscription_ratio, 'reserved_percentage': reserved_percentage, 'replication_enabled': self.replication_enabled}
            if array_reserve_percent:
                if isinstance(reserved_percentage, int):
                    if (array_reserve_percent > reserved_percentage):
                        pool['reserved_percentage'] = array_reserve_percent
                else:
                    pool['reserved_percentage'] = array_reserve_percent
        if (max_oversubscription_ratio and (0.0 < max_oversubscription_ratio < 1)):
            pool['max_over_subscription_ratio'] = self.utils.get_default_oversubscription_ratio(max_oversubscription_ratio)
        pools.append(pool)
    pools = self.utils.add_legacy_pools(pools)
    data = {'vendor_name': 'Dell    EMC', 'driver_version': self.version, 'storage_protocol': 'unknown', 'volume_backend_name': (backend_name or self.__class__.__name__), 'total_capacity_gb': 0, 'free_capacity_gb': 0, 'provisioned_capacity_gb': 0, 'reserved_percentage': 0, 'replication_enabled': self.replication_enabled, 'replication_targets': self.replication_targets, 'pools': pools}
    return data
