spark_plugin.py
def _get_streaming_metrics(self, apps):
        """
        Get streaming metrics corresponding to a streaming application

        Args:
        apps (dict): Mapping of application id to app name, user,
                     and url endpoint for API call
        """
        for app_id, (app_name, app_user, tracking_url) in apps.items():
            resp = self.spark_agent.request_metrics(tracking_url, APPS_ENDPOINT, app_id, "streaming/statistics")
            if not resp:
                continue

            dim = {"app_name": str(app_name), "user": str(app_user)}
            dim.update(self.global_dimensions)

            stream_stat_metrics = self.metrics[(app_name, app_user)]

            for key, (metric_type, metric_name) in metrics.SPARK_STREAMING_METRICS.items():

                if key not in resp:
                    continue
                metric_value = resp[key]

                mr = stream_stat_metrics.get(key, MetricRecord(metric_name, metric_type, 0, dim))
                mr.value += metric_value
                stream_stat_metrics[key] = mr

        Get streaming metrics corresponding to a streaming application

        Args:
        apps (dict): Mapping of application id to app name, user,
                     and url endpoint for API call
        
Get streaming metrics corresponding to a streaming application
Args:
apps (dict): Mapping of application id to app name, user,
and url endpoint for API call
Get streaming metrics corresponding to a streaming application Args : apps ( dict ) : Mapping of application id to app name user and url endpoint for API call
def _get_streaming_metrics(self, apps):
        for app_id, (app_name, app_user, tracking_url) in apps.items():
            resp = self.spark_agent.request_metrics(tracking_url, APPS_ENDPOINT, app_id, "streaming/statistics")
            if not resp:
                continue
            dim = {"app_name": str(app_name), "user": str(app_user)}
            dim.update(self.global_dimensions)
            stream_stat_metrics = self.metrics[(app_name, app_user)]
            for key, (metric_type, metric_name) in metrics.SPARK_STREAMING_METRICS.items():
                if key not in resp:
                    continue
                metric_value = resp[key]
                mr = stream_stat_metrics.get(key, MetricRecord(metric_name, metric_type, 0, dim))
                mr.value += metric_value
                stream_stat_metrics[key] = mr
def _get_streaming_metrics ( self , apps ) : for app_id , ( app_name , app_user , tracking_url ) in apps . items ( ) : resp = self . spark_agent . request_metrics ( tracking_url , APPS_ENDPOINT , app_id , "streaming/statistics" ) if not resp : continue dim = { "app_name" : str ( app_name ) , "user" : str ( app_user ) } dim . update ( self . global_dimensions ) stream_stat_metrics = self . metrics [ ( app_name , app_user ) ] for key , ( metric_type , metric_name ) in metrics . SPARK_STREAMING_METRICS . items ( ) : if key not in resp : continue metric_value = resp [ key ] mr = stream_stat_metrics . get ( key , MetricRecord ( metric_name , metric_type , 0 , dim ) ) mr . value += metric_value stream_stat_metrics [ key ] = mr
Get streaming metrics corresponding to a streaming application
Args:
apps (dict): Mapping of application id to app name, user,
and url endpoint for API call
Get streaming metrics corresponding to a streaming application Args : apps ( dict ) : Mapping of application id to app name user and url endpoint for API call
"""
        Get streaming metrics corresponding to a streaming application

        Args:
        apps (dict): Mapping of application id to app name, user,
                     and url endpoint for API call
        """
self
apps