(self, response, scraper_config)
Parse the MetricFamily from a valid `requests.Response` object to provide a MetricFamily object.
        The text format uses iter_lines() generator.
Parse the MetricFamily from a valid `requests.Response` object to provide a MetricFamily object.
        The text format uses iter_lines() generator.
Parse the MetricFamily from a valid requests . Response object to provide a MetricFamily object . The text format uses iter_lines () generator .
def parse_metric_family(self, response, scraper_config):
        """
        Parse the MetricFamily from a valid `requests.Response` object to provide a MetricFamily object.
        The text format uses iter_lines() generator.
        """
        if response.encoding is None:
            response.encoding = 'utf-8'
        input_gen = response.iter_lines(decode_unicode=True)
        if scraper_config['_text_filter_blacklist']:
            input_gen = self._text_filter_input(input_gen, scraper_config)

        for metric in text_fd_to_metric_families(input_gen):
            self._send_telemetry_counter(
                self.TELEMETRY_COUNTER_METRICS_INPUT_COUNT, len(metric.samples), scraper_config
            )
            type_override = scraper_config['type_overrides'].get(metric.name)
            if type_override:
                metric.type = type_override
            elif scraper_config['_type_override_patterns']:
                for pattern, new_type in iteritems(scraper_config['_type_override_patterns']):
                    if pattern.search(metric.name):
                        metric.type = new_type
                        break
            if metric.type not in self.METRIC_TYPES:
                continue
            metric.name = self._remove_metric_prefix(metric.name, scraper_config)
            yield metric
def parse_metric_family ( self , response , scraper_config ) : if response . encoding is None : response . encoding = 'utf-8' input_gen = response . iter_lines ( decode_unicode = True ) if scraper_config [ '_text_filter_blacklist' ] : input_gen = self . _text_filter_input ( input_gen , scraper_config ) for metric in text_fd_to_metric_families ( input_gen ) : self . _send_telemetry_counter ( self . TELEMETRY_COUNTER_METRICS_INPUT_COUNT , len ( metric . samples ) , scraper_config ) type_override = scraper_config [ 'type_overrides' ] . get ( metric . name ) if type_override : metric . type = type_override elif scraper_config [ '_type_override_patterns' ] : for pattern , new_type in iteritems ( scraper_config [ '_type_override_patterns' ] ) : if pattern . search ( metric . name ) : metric . type = new_type break if metric . type not in self . METRIC_TYPES : continue metric . name = self . _remove_metric_prefix ( metric . name , scraper_config ) yield metric