(self, data, custom_tags=None, active_tag=None)
Data is a dictionary related to one host
        (one line) extracted from the csv.
        It should look like:
        {'pxname':'dogweb', 'svname':'i-4562165', 'scur':'42', ...}
Data is a dictionary related to one host
        (one line) extracted from the csv.
        It should look like:
        {'pxname':'dogweb', 'svname':'i-4562165', 'scur':'42', ...}
Data is a dictionary related to one host ( one line ) extracted from the csv . It should look like : { pxname : dogweb svname : i - 4562165 scur : 42 ... }
def _process_metrics(self, data, custom_tags=None, active_tag=None):
        """
        Data is a dictionary related to one host
        (one line) extracted from the csv.
        It should look like:
        {'pxname':'dogweb', 'svname':'i-4562165', 'scur':'42', ...}
        """
        hostname = data['svname']
        service_name = data['pxname']
        back_or_front = data['back_or_front']
        custom_tags = [] if custom_tags is None else custom_tags
        active_tag = [] if active_tag is None else active_tag
        tags = ["type:%s" % back_or_front, "instance_url:%s" % self.url, "haproxy_service:%s" % service_name]
        tags.extend(custom_tags)
        tags.extend(active_tag)
        self._handle_legacy_service_tag(tags, service_name)

        if self._is_service_excl_filtered(service_name):
            return

        if back_or_front == Services.BACKEND:
            tags.append('backend:%s' % hostname)
            if data.get('addr'):
                tags.append('server_address:{}'.format(data.get('addr')))

        for key, value in data.items():
            if METRICS.get(key):
                if isinstance(METRICS[key], list):
                    for metric_tuple in METRICS[key]:
                        self._submit_metric_tuple(metric_tuple[0], metric_tuple[1], back_or_front, value, tags)
                else:
                    self._submit_metric_tuple(METRICS[key][0], METRICS[key][1], back_or_front, value, tags)
def _process_metrics ( self , data , custom_tags = None , active_tag = None ) : hostname = data [ 'svname' ] service_name = data [ 'pxname' ] back_or_front = data [ 'back_or_front' ] custom_tags = [ ] if custom_tags is None else custom_tags active_tag = [ ] if active_tag is None else active_tag tags = [ "type:%s" % back_or_front , "instance_url:%s" % self . url , "haproxy_service:%s" % service_name ] tags . extend ( custom_tags ) tags . extend ( active_tag ) self . _handle_legacy_service_tag ( tags , service_name ) if self . _is_service_excl_filtered ( service_name ) : return if back_or_front == Services . BACKEND : tags . append ( 'backend:%s' % hostname ) if data . get ( 'addr' ) : tags . append ( 'server_address:{}' . format ( data . get ( 'addr' ) ) ) for key , value in data . items ( ) : if METRICS . get ( key ) : if isinstance ( METRICS [ key ] , list ) : for metric_tuple in METRICS [ key ] : self . _submit_metric_tuple ( metric_tuple [ 0 ] , metric_tuple [ 1 ] , back_or_front , value , tags ) else : self . _submit_metric_tuple ( METRICS [ key ] [ 0 ] , METRICS [ key ] [ 1 ] , back_or_front , value , tags )