(self, tags)
return running_apps
Return a dictionary of {app_id: (app_name, tracking_url)} for the running Spark applications
Return a dictionary of {app_id: (app_name, tracking_url)} for the running Spark applications
Return a dictionary of { app_id : ( app_name tracking_url ) } for the running Spark applications
def _driver_init(self, tags):
        """
        Return a dictionary of {app_id: (app_name, tracking_url)} for the running Spark applications
        """
        self._collect_version(self.master_address, tags)
        running_apps = {}
        metrics_json = self._rest_request_to_json(
            self.master_address, SPARK_APPS_PATH, SPARK_DRIVER_SERVICE_CHECK, tags
        )

        for app_json in metrics_json:
            app_id = app_json.get('id')
            app_name = app_json.get('name')
            running_apps[app_id] = (app_name, self.master_address)

        self.service_check(
            SPARK_DRIVER_SERVICE_CHECK,
            AgentCheck.OK,
            tags=['url:%s' % self.master_address] + tags,
        )
        self.log.info("Returning running apps %s", running_apps)
        return running_apps
def _driver_init ( self , tags ) : self . _collect_version ( self . master_address , tags ) running_apps = { } metrics_json = self . _rest_request_to_json ( self . master_address , SPARK_APPS_PATH , SPARK_DRIVER_SERVICE_CHECK , tags ) for app_json in metrics_json : app_id = app_json . get ( 'id' ) app_name = app_json . get ( 'name' ) running_apps [ app_id ] = ( app_name , self . master_address ) self . service_check ( SPARK_DRIVER_SERVICE_CHECK , AgentCheck . OK , tags = [ 'url:%s' % self . master_address ] + tags , ) self . log . info ( "Returning running apps %s" , running_apps ) return running_apps