(
        self,
        metrics,  # type: List[ParsedMetric]
        results,  # type: Dict[str, Dict[Tuple[str, ...], Any]]
        tags,  # type: List[str]
    )
For each of the metrics specified gather the tags requested in the
        instance conf for each row.

        Submit the results to the aggregator.
For each of the metrics specified gather the tags requested in the
        instance conf for each row.
For each of the metrics specified gather the tags requested in the instance conf for each row .
def report_metrics(
        self,
        metrics,  # type: List[ParsedMetric]
        results,  # type: Dict[str, Dict[Tuple[str, ...], Any]]
        tags,  # type: List[str]
    ):
        # type: (...) -> None
        """
        For each of the metrics specified gather the tags requested in the
        instance conf for each row.

        Submit the results to the aggregator.
        """
        for metric in metrics:
            name = metric.name
            if name not in results:
                self.log.debug('Ignoring metric %s', name)
                continue
            if isinstance(metric, ParsedTableMetric):
                for index, val in iteritems(results[name]):
                    metric_tags = tags + self.get_index_tags(index, results, metric.index_tags, metric.column_tags)
                    self.submit_metric(
                        name, val, metric.forced_type, metric_tags, metric.options, metric.extract_value_pattern
                    )
                    self.try_submit_bandwidth_usage_metric_if_bandwidth_metric(name, index, results, metric_tags)
            else:
                result = list(results[name].items())
                if len(result) > 1:
                    self.log.warning('Several rows corresponding while the metric is supposed to be a scalar')
                    if metric.enforce_scalar:
                        # For backward compatibility reason, we publish the first value for OID.
                        continue
                val = result[0][1]
                metric_tags = tags + metric.tags
                self.submit_metric(
                    name, val, metric.forced_type, metric_tags, metric.options, metric.extract_value_pattern
                )
def report_metrics ( self , metrics , # type: List[ParsedMetric] results , # type: Dict[str, Dict[Tuple[str, ...], Any]] tags , # type: List[str] ) : # type: (...) -> None for metric in metrics : name = metric . name if name not in results : self . log . debug ( 'Ignoring metric %s' , name ) continue if isinstance ( metric , ParsedTableMetric ) : for index , val in iteritems ( results [ name ] ) : metric_tags = tags + self . get_index_tags ( index , results , metric . index_tags , metric . column_tags ) self . submit_metric ( name , val , metric . forced_type , metric_tags , metric . options , metric . extract_value_pattern ) self . try_submit_bandwidth_usage_metric_if_bandwidth_metric ( name , index , results , metric_tags ) else : result = list ( results [ name ] . items ( ) ) if len ( result ) > 1 : self . log . warning ( 'Several rows corresponding while the metric is supposed to be a scalar' ) if metric . enforce_scalar : # For backward compatibility reason, we publish the first value for OID. continue val = result [ 0 ] [ 1 ] metric_tags = tags + metric . tags self . submit_metric ( name , val , metric . forced_type , metric_tags , metric . options , metric . extract_value_pattern )