(
        self,
        index,  # type: Tuple[str, ...]
        results,  # type: Dict[str, dict]
        index_tags,  # type: List[IndexTag]
        column_tags,  # type: List[ColumnTag]
    )
return tags
Gather the tags for this row of the table (index) based on the
        results (all the results from the query).
        index_tags and column_tags are the tags to gather.
         - Those specified in index_tags contain the tag_group name and the
           index of the value we want to extract from the index tuple.
           cf. 1 for ipVersion in the IP-MIB::ipSystemStatsTable for example
         - Those specified in column_tags contain the name of a column, which
           could be a potential result, to use as a tag
           cf. ifDescr in the IF-MIB::ifTable for example
Gather the tags for this row of the table (index) based on the
        results (all the results from the query).
        index_tags and column_tags are the tags to gather.
         - Those specified in index_tags contain the tag_group name and the
           index of the value we want to extract from the index tuple.
           cf. 1 for ipVersion in the IP-MIB::ipSystemStatsTable for example
         - Those specified in column_tags contain the name of a column, which
           could be a potential result, to use as a tag
           cf. ifDescr in the IF-MIB::ifTable for example
Gather the tags for this row of the table ( index ) based on the results ( all the results from the query ) . index_tags and column_tags are the tags to gather . - Those specified in index_tags contain the tag_group name and the index of the value we want to extract from the index tuple . cf . 1 for ipVersion in the IP - MIB :: ipSystemStatsTable for example - Those specified in column_tags contain the name of a column which could be a potential result to use as a tag cf . ifDescr in the IF - MIB :: ifTable for example
def get_index_tags(
        self,
        index,  # type: Tuple[str, ...]
        results,  # type: Dict[str, dict]
        index_tags,  # type: List[IndexTag]
        column_tags,  # type: List[ColumnTag]
    ):
        # type: (...) -> List[str]
        """
        Gather the tags for this row of the table (index) based on the
        results (all the results from the query).
        index_tags and column_tags are the tags to gather.
         - Those specified in index_tags contain the tag_group name and the
           index of the value we want to extract from the index tuple.
           cf. 1 for ipVersion in the IP-MIB::ipSystemStatsTable for example
         - Those specified in column_tags contain the name of a column, which
           could be a potential result, to use as a tag
           cf. ifDescr in the IF-MIB::ifTable for example
        """
        tags = []  # type: List[str]

        for index_tag in index_tags:
            raw_index_value = index_tag.index
            try:
                value = index[raw_index_value - 1]
            except IndexError:
                self.log.warning('Not enough indexes, skipping index %s', raw_index_value)
                continue
            tags.extend(index_tag.parsed_metric_tag.matched_tags(value))

        for column_tag in column_tags:
            raw_column_value = column_tag.column
            self.log.trace(
                'Processing column tag: raw_column_value=%s index_slices=%s', raw_column_value, column_tag.index_slices
            )
            if column_tag.index_slices:
                new_index = transform_index(index, column_tag.index_slices)
            else:
                new_index = index
            self.log.trace('Processing column tag: new_index=%s old_index=%s', new_index, index)
            if new_index is None:
                continue
            try:
                column_value = results[raw_column_value][new_index]
            except KeyError:
                self.log.debug(
                    'Column `%s not present in the table, skipping this tag. index=%s', raw_column_value, new_index
                )
                continue
            if reply_invalid(column_value):
                self.log.warning("Can't deduct tag from column %s", column_tag.column)
                continue
            value = column_value.prettyPrint()
            tags.extend(column_tag.parsed_metric_tag.matched_tags(value))
        return tags
def get_index_tags ( self , index , # type: Tuple[str, ...] results , # type: Dict[str, dict] index_tags , # type: List[IndexTag] column_tags , # type: List[ColumnTag] ) : # type: (...) -> List[str] tags = [ ] # type: List[str] for index_tag in index_tags : raw_index_value = index_tag . index try : value = index [ raw_index_value - 1 ] except IndexError : self . log . warning ( 'Not enough indexes, skipping index %s' , raw_index_value ) continue tags . extend ( index_tag . parsed_metric_tag . matched_tags ( value ) ) for column_tag in column_tags : raw_column_value = column_tag . column self . log . trace ( 'Processing column tag: raw_column_value=%s index_slices=%s' , raw_column_value , column_tag . index_slices ) if column_tag . index_slices : new_index = transform_index ( index , column_tag . index_slices ) else : new_index = index self . log . trace ( 'Processing column tag: new_index=%s old_index=%s' , new_index , index ) if new_index is None : continue try : column_value = results [ raw_column_value ] [ new_index ] except KeyError : self . log . debug ( 'Column `%s not present in the table, skipping this tag. index=%s' , raw_column_value , new_index ) continue if reply_invalid ( column_value ) : self . log . warning ( "Can't deduct tag from column %s" , column_tag . column ) continue value = column_value . prettyPrint ( ) tags . extend ( column_tag . parsed_metric_tag . matched_tags ( value ) ) return tags