(self, rm_address, addl_tags)
Get metrics related to YARN nodes
Get metrics related to YARN nodes
Get metrics related to YARN nodes
def _yarn_node_metrics(self, rm_address, addl_tags):
        """
        Get metrics related to YARN nodes
        """
        metrics_json = self._rest_request_to_json(rm_address, YARN_NODES_PATH, addl_tags)
        version_set = False

        if metrics_json and metrics_json.get('nodes') and metrics_json['nodes'].get('node') is not None:
            for node_json in metrics_json['nodes']['node']:
                node_id = node_json['id']

                tags = ['node_id:{}'.format(str(node_id))]
                tags.extend(addl_tags)

                self._set_yarn_metrics_from_json(tags, node_json, YARN_NODE_METRICS)
                version = node_json.get('version')
                if not version_set and version:
                    self.set_metadata('version', version)
                    version_set = True
def _yarn_node_metrics ( self , rm_address , addl_tags ) : metrics_json = self . _rest_request_to_json ( rm_address , YARN_NODES_PATH , addl_tags ) version_set = False if metrics_json and metrics_json . get ( 'nodes' ) and metrics_json [ 'nodes' ] . get ( 'node' ) is not None : for node_json in metrics_json [ 'nodes' ] [ 'node' ] : node_id = node_json [ 'id' ] tags = [ 'node_id:{}' . format ( str ( node_id ) ) ] tags . extend ( addl_tags ) self . _set_yarn_metrics_from_json ( tags , node_json , YARN_NODE_METRICS ) version = node_json . get ( 'version' ) if not version_set and version : self . set_metadata ( 'version' , version ) version_set = True