(self, stats, prefix, tags, recursion_level=0)
The XML will have Stat Nodes and Nodes that contain the metrics themselves
        This code recursively goes through each Stat Node to properly setup tags
        where each Stat will have a different tag key depending on the context.
The XML will have Stat Nodes and Nodes that contain the metrics themselves
        This code recursively goes through each Stat Node to properly setup tags
        where each Stat will have a different tag key depending on the context.
The XML will have Stat Nodes and Nodes that contain the metrics themselves This code recursively goes through each Stat Node to properly setup tags where each Stat will have a different tag key depending on the context .
def process_stats(self, stats, prefix, tags, recursion_level=0):
        """
        The XML will have Stat Nodes and Nodes that contain the metrics themselves
        This code recursively goes through each Stat Node to properly setup tags
        where each Stat will have a different tag key depending on the context.
        """
        for child in stats:
            if child.tag in metrics.METRIC_VALUE_FIELDS:
                self.submit_metrics(child, prefix, tags)
            elif child.tag in metrics.CATEGORY_FIELDS:
                tag_list = self.nested_tags.get(prefix)
                if tag_list and len(tag_list) > recursion_level:
                    recursion_tags = tags + ['{}:{}'.format(tag_list[recursion_level], child.get('name'))]
                else:
                    recursion_tags = tags
                self.process_stats(child, prefix, recursion_tags, recursion_level + 1)
def process_stats ( self , stats , prefix , tags , recursion_level = 0 ) : for child in stats : if child . tag in metrics . METRIC_VALUE_FIELDS : self . submit_metrics ( child , prefix , tags ) elif child . tag in metrics . CATEGORY_FIELDS : tag_list = self . nested_tags . get ( prefix ) if tag_list and len ( tag_list ) > recursion_level : recursion_tags = tags + [ '{}:{}' . format ( tag_list [ recursion_level ] , child . get ( 'name' ) ) ] else : recursion_tags = tags self . process_stats ( child , prefix , recursion_tags , recursion_level + 1 )