r'''
    Create a list of Counter objects to be used in the pdh query

    Args:
        counter_list (list):
            A list of tuples containing counter information. Each tuple should
            contain the object, instance, and counter name. For example, to
            get the ``% Processor Time`` counter for all Processors on the
            system (``\Processor(*)\% Processor Time``) you would pass a tuple
            like this:

            ```
            counter_list = [('Processor', '*', '% Processor Time')]
            ```

            If there is no ``instance`` for the counter, pass ``None``

            Multiple counters can be passed like so:

            ```
            counter_list = [('Processor', '*', '% Processor Time'),
                            ('System', None, 'Context Switches/sec')]
            ```

            .. note::
                Invalid counters are ignored

    Returns:
        list: A list of Counter objects

def build_counter_list(counter_list):
    r'''
    Create a list of Counter objects to be used in the pdh query

    Args:
        counter_list (list):
            A list of tuples containing counter information. Each tuple should
            contain the object, instance, and counter name. For example, to
            get the ``% Processor Time`` counter for all Processors on the
            system (``\Processor(*)\% Processor Time``) you would pass a tuple
            like this:

            ```
            counter_list = [('Processor', '*', '% Processor Time')]
            ```

            If there is no ``instance`` for the counter, pass ``None``

            Multiple counters can be passed like so:

            ```
            counter_list = [('Processor', '*', '% Processor Time'),
                            ('System', None, 'Context Switches/sec')]
            ```

            .. note::
                Invalid counters are ignored

    Returns:
        list: A list of Counter objects
    '''
    counters = []
    index = 0
    for obj, instance, counter_name in counter_list:
        try:
            counter = Counter.build_counter(obj, instance, index, counter_name)
            index += 1
            counters.append(counter)
        except CommandExecutionError as exc:
            # Not a valid counter
            log.debug(exc.strerror)
            continue
    return counters