'Retrieve pool (Data ONTAP flexvol) stats.
Pool statistics are assembled from static driver capabilities, the
Storage Service Catalog of flexvol attributes, and real-time capacity
and controller utilization metrics.  The pool name is the flexvol name.'

def _get_pool_stats(self, filter_function=None, goodness_function=None):

    pools = []
    ssc = self.ssc_library.get_ssc()
    if (not ssc):
        return pools
    if self.using_cluster_credentials:
        self.perf_library.update_performance_cache(ssc)
        aggregates = self.ssc_library.get_ssc_aggregates()
        aggr_capacities = self.zapi_client.get_aggregate_capacities(aggregates)
    else:
        aggr_capacities = {}
    for (ssc_vol_name, ssc_vol_info) in ssc.items():
        pool = dict()
        pool.update(ssc_vol_info)
        pool['QoS_support'] = True
        pool['multiattach'] = False
        pool['consistencygroup_support'] = True
        pool['consistent_group_snapshot_enabled'] = True
        pool['reserved_percentage'] = self.reserved_percentage
        pool['max_over_subscription_ratio'] = self.max_over_subscription_ratio
        capacity = self.zapi_client.get_flexvol_capacity(flexvol_name=ssc_vol_name)
        size_total_gb = (capacity['size-total'] / units.Gi)
        pool['total_capacity_gb'] = na_utils.round_down(size_total_gb)
        size_available_gb = (capacity['size-available'] / units.Gi)
        pool['free_capacity_gb'] = na_utils.round_down(size_available_gb)
        pool['provisioned_capacity_gb'] = round((pool['total_capacity_gb'] - pool['free_capacity_gb']), 2)
        if self.using_cluster_credentials:
            dedupe_used = self.zapi_client.get_flexvol_dedupe_used_percent(ssc_vol_name)
        else:
            dedupe_used = 0.0
        pool['netapp_dedupe_used_percent'] = na_utils.round_down(dedupe_used)
        aggregate_name = ssc_vol_info.get('netapp_aggregate')
        aggr_capacity = aggr_capacities.get(aggregate_name, {})
        pool['netapp_aggregate_used_percent'] = aggr_capacity.get('percent-used', 0)
        utilization = self.perf_library.get_node_utilization_for_pool(ssc_vol_name)
        pool['utilization'] = na_utils.round_down(utilization)
        pool['filter_function'] = filter_function
        pool['goodness_function'] = goodness_function
        pool.update(self.get_replication_backend_stats(self.configuration))
        pools.append(pool)
    return pools
