def metric_count_active(result, base_key, count):
    """Counts the number of chain active ("o") for the specified keys."""
    active = 0
    base_keys = base_key.split(",")
    for base_key in base_keys:
        for i in range(1, count):
            key = base_key.replace("[i]", str(i))
            if key in result:
                active += str(result[key]).count('o')
    return active