def _mapreduce_task_metrics(self, running_jobs, addl_tags):
    "\n        Get metrics for each MapReduce task\n        Return a dictionary of {task_id: 'tracking_url'} for each MapReduce task\n        "
    for (job_id, job_stats) in running_jobs.iteritems():
        metrics_json = self._rest_request_to_json(job_stats['tracking_url'], 'tasks', MAPREDUCE_SERVICE_CHECK)
        if metrics_json.get('tasks'):
            if metrics_json['tasks'].get('task'):
                for task in metrics_json['tasks']['task']:
                    task_type = task.get('type')
                    if task_type:
                        tags = [('app_name:' + job_stats['app_name']), ('user_name:' + job_stats['user_name']), ('job_name:' + job_stats['job_name']), ('task_type:' + str(task_type).lower())]
                        tags.extend(addl_tags)
                        if (task_type == 'MAP'):
                            self._set_metrics_from_json(tags, task, MAPREDUCE_MAP_TASK_METRICS)
                        elif (task_type == 'REDUCE'):
                            self._set_metrics_from_json(tags, task, MAPREDUCE_REDUCE_TASK_METRICS)
Get metrics for each MapReduce task
Return a dictionary of {task_id: 'tracking_url'} for each MapReduce task
def _mapreduce_task_metrics(self, running_jobs, addl_tags):
    "\n        Get metrics for each MapReduce task\n        Return a dictionary of {task_id: 'tracking_url'} for each MapReduce task\n        "
    for (job_id, job_stats) in running_jobs.iteritems():
        metrics_json = self._rest_request_to_json(job_stats['tracking_url'], 'tasks', MAPREDUCE_SERVICE_CHECK)
        if metrics_json.get('tasks'):
            if metrics_json['tasks'].get('task'):
                for task in metrics_json['tasks']['task']:
                    task_type = task.get('type')
                    if task_type:
                        tags = [('app_name:' + job_stats['app_name']), ('user_name:' + job_stats['user_name']), ('job_name:' + job_stats['job_name']), ('task_type:' + str(task_type).lower())]
                        tags.extend(addl_tags)
                        if (task_type == 'MAP'):
                            self._set_metrics_from_json(tags, task, MAPREDUCE_MAP_TASK_METRICS)
                        elif (task_type == 'REDUCE'):
                            self._set_metrics_from_json(tags, task, MAPREDUCE_REDUCE_TASK_METRICS)