(self, running_apps, addl_tags)
Get metrics for each Spark RDD.
Get metrics for each Spark RDD.
Get metrics for each Spark RDD .
def _spark_rdd_metrics(self, running_apps, addl_tags):
        """
        Get metrics for each Spark RDD.
        """
        for app_id, (app_name, tracking_url) in iteritems(running_apps):

            base_url = self._get_request_url(tracking_url)
            response = self._rest_request_to_json(
                base_url, SPARK_APPS_PATH, SPARK_SERVICE_CHECK, addl_tags, app_id, 'storage/rdd'
            )

            tags = ['app_name:%s' % str(app_name)]
            tags.extend(addl_tags)

            for rdd in response:
                self._set_metrics_from_json(tags, rdd, SPARK_RDD_METRICS)

            if len(response):
                self._set_metric('spark.rdd.count', COUNT, len(response), tags)
def _spark_rdd_metrics ( self , running_apps , addl_tags ) : for app_id , ( app_name , tracking_url ) in iteritems ( running_apps ) : base_url = self . _get_request_url ( tracking_url ) response = self . _rest_request_to_json ( base_url , SPARK_APPS_PATH , SPARK_SERVICE_CHECK , addl_tags , app_id , 'storage/rdd' ) tags = [ 'app_name:%s' % str ( app_name ) ] tags . extend ( addl_tags ) for rdd in response : self . _set_metrics_from_json ( tags , rdd , SPARK_RDD_METRICS ) if len ( response ) : self . _set_metric ( 'spark.rdd.count' , COUNT , len ( response ) , tags )