def _mapreduce_job_metrics(self, running_apps, addl_tags):
    "\n        Get metrics for each MapReduce job.\n        Return a dictionary for each MapReduce job\n        {\n          job_id: {\n            'job_name': job_name,\n            'app_name': app_name,\n            'user_name': user_name,\n            'tracking_url': tracking_url\n        }\n        "
    running_jobs = {}
    for (app_id, (app_name, tracking_url)) in running_apps.iteritems():
        metrics_json = self._rest_request_to_json(tracking_url, MAPREDUCE_JOBS_PATH, MAPREDUCE_SERVICE_CHECK)
        if metrics_json.get('jobs'):
            if metrics_json['jobs'].get('job'):
                for job_json in metrics_json['jobs']['job']:
                    job_id = job_json.get('id')
                    job_name = job_json.get('name')
                    user_name = job_json.get('user')
                    if (job_id and job_name and user_name):
                        running_jobs[str(job_id)] = {'job_name': str(job_name), 'app_name': str(app_name), 'user_name': str(user_name), 'tracking_url': self._join_url_dir(tracking_url, MAPREDUCE_JOBS_PATH, job_id)}
                        tags = [('app_name:' + str(app_name)), ('user_name:' + str(user_name)), ('job_name:' + str(job_name))]
                        tags.extend(addl_tags)
                        self._set_metrics_from_json(tags, job_json, MAPREDUCE_JOB_METRICS)
    return running_jobs
Get metrics for each MapReduce job.
Return a dictionary for each MapReduce job
{
  job_id: {
    'job_name': job_name,
    'app_name': app_name,
    'user_name': user_name,
    'tracking_url': tracking_url
}
def _mapreduce_job_metrics(self, running_apps, addl_tags):
    "\n        Get metrics for each MapReduce job.\n        Return a dictionary for each MapReduce job\n        {\n          job_id: {\n            'job_name': job_name,\n            'app_name': app_name,\n            'user_name': user_name,\n            'tracking_url': tracking_url\n        }\n        "
    running_jobs = {}
    for (app_id, (app_name, tracking_url)) in running_apps.iteritems():
        metrics_json = self._rest_request_to_json(tracking_url, MAPREDUCE_JOBS_PATH, MAPREDUCE_SERVICE_CHECK)
        if metrics_json.get('jobs'):
            if metrics_json['jobs'].get('job'):
                for job_json in metrics_json['jobs']['job']:
                    job_id = job_json.get('id')
                    job_name = job_json.get('name')
                    user_name = job_json.get('user')
                    if (job_id and job_name and user_name):
                        running_jobs[str(job_id)] = {'job_name': str(job_name), 'app_name': str(app_name), 'user_name': str(user_name), 'tracking_url': self._join_url_dir(tracking_url, MAPREDUCE_JOBS_PATH, job_id)}
                        tags = [('app_name:' + str(app_name)), ('user_name:' + str(user_name)), ('job_name:' + str(job_name))]
                        tags.extend(addl_tags)
                        self._set_metrics_from_json(tags, job_json, MAPREDUCE_JOB_METRICS)
    return running_jobs