def get_formatted_host_data(self , extn = "html" ):
		"""
		Returns formatted host information data.
		"""
		# find the pretty print length
		host_info =''
		for host_name , job_list in self.host_job_map.items():
			# Case where host_name is not calculated
			if host_name is None:
				host_info += ( " \n{ \"name\":"  + "\"Unknown\" , \"jobs\": [")
			else:
				host_info += ( " \n{ \"name\":"  + "\"" + host_name+ "\" , \"jobs\": [")
			job_info = ''
			for job_stat in job_list:
				job_stat_det = job_stat.getJobDetails(self.dagman_start_time)
				job_info +=("\n\t{")
				job_info +=( "\n\t")
				job_info += ( "\"name\":"  + "\"" + job_stat_det['name']+ "\" , ")
				job_info += ( "\"jobS\":" +  job_stat_det['jobExecS'] +" , ")
				job_info += ( "\"jobD\":" +  job_stat_det['jobExecD'] +" , ")
				job_info += ( "\"preS\":" +  job_stat_det['preS'] +" , ")
				job_info += ( "\"preD\":" +  job_stat_det['preD'] +" , ")
				job_info += ( "\"cS\":"  +  job_stat_det['cS'] +" , ")
				job_info += ( "\"cD\":"    +  job_stat_det['cD']  +" , ")
				job_info += ( "\"gS\":"    +  job_stat_det['gS']  +" , ")
				job_info += ( "\"gD\":"    +  job_stat_det['gD']  +" , ")
				job_info += ( "\"eS\":"    +  job_stat_det['eS']  +" , ")
				job_info += ( "\"eD\":"    +  job_stat_det['eD']  +" , ")
				job_info += ( "\"kS\":"    +  job_stat_det['kS']  +" , ")
				job_info += ( "\"kD\":"    +  job_stat_det['kD']  +" , ")
				job_info += ( "\"postS\":" +  job_stat_det['postS'] +" , ")
				job_info += ( "\"postD\":" +  job_stat_det['postD'] +" , ")
				job_info += ( "\"state\":" +  job_stat_det['state'] +" , ")
				job_info += ( "\"transformation\": \"" +  job_stat_det['transformation'] +"\"  , ")
				if self.transformation_color_map.has_key(job_stat_det['transformation']):
					job_info += ( "\"color\": \"" +  self.transformation_color_map[job_stat_det['transformation']] +"\"  , ")
				else:
					# there is no compute task
					job_info += ( "\"color\": 'white' , ")
				if plot_utils.isSubWfJob(job_stat_det['name']):
					job_info += ( "\"sub_wf\":1 , "  )
					corresponding_dax =''
					if (self.job_instance_id_sub_wf_uuid_map.has_key(job_stat_det['instance_id'])): 
						corresponding_dax = self.job_instance_id_sub_wf_uuid_map[job_stat_det['instance_id']]
						job_info += ( "\"sub_wf_name\":\""+ corresponding_dax+ "." + extn +"\"")
					else:
						job_info += ( "\"sub_wf_name\":''")	
						
				else:
					job_info += ( "\"sub_wf\":0 , " )	
					job_info += ( "\"sub_wf_name\":''")
				job_info +=( "\n\t},\n")
			host_info+= job_info
			host_info += "]},"	
		return host_info
Exemple #2
0
	def get_formatted_host_data(self , extn = "html" ):
		"""
		Returns formatted host information data.
		"""
		# find the pretty print length
		host_info =''
		for host_name , job_list in self.host_job_map.items():
			# Case where host_name is not calculated
			if host_name is None:
				host_info += ( " \n{ \"name\":"  + "\"Unknown\" , \"jobs\": [")
			else:
				host_info += ( " \n{ \"name\":"  + "\"" + host_name+ "\" , \"jobs\": [")
			job_info = ''
			for job_stat in job_list:
				job_stat_det = job_stat.getJobDetails(self.dagman_start_time)
				job_info +=("\n\t{")
				job_info +=( "\n\t")
				job_info += ( "\"name\":"  + "\"" + job_stat_det['name']+ "\" , ")
				job_info += ( "\"jobS\":" +  job_stat_det['jobExecS'] +" , ")
				job_info += ( "\"jobD\":" +  job_stat_det['jobExecD'] +" , ")
				job_info += ( "\"preS\":" +  job_stat_det['preS'] +" , ")
				job_info += ( "\"preD\":" +  job_stat_det['preD'] +" , ")
				job_info += ( "\"cS\":"  +  job_stat_det['cS'] +" , ")
				job_info += ( "\"cD\":"    +  job_stat_det['cD']  +" , ")
				job_info += ( "\"gS\":"    +  job_stat_det['gS']  +" , ")
				job_info += ( "\"gD\":"    +  job_stat_det['gD']  +" , ")
				job_info += ( "\"eS\":"    +  job_stat_det['eS']  +" , ")
				job_info += ( "\"eD\":"    +  job_stat_det['eD']  +" , ")
				job_info += ( "\"kS\":"    +  job_stat_det['kS']  +" , ")
				job_info += ( "\"kD\":"    +  job_stat_det['kD']  +" , ")
				job_info += ( "\"postS\":" +  job_stat_det['postS'] +" , ")
				job_info += ( "\"postD\":" +  job_stat_det['postD'] +" , ")
				job_info += ( "\"state\":" +  job_stat_det['state'] +" , ")
				job_info += ( "\"transformation\": \"" +  job_stat_det['transformation'] +"\"  , ")
				if self.transformation_color_map.has_key(job_stat_det['transformation']):
					job_info += ( "\"color\": \"" +  self.transformation_color_map[job_stat_det['transformation']] +"\"  , ")
				else:
					# there is no compute task
					job_info += ( "\"color\": 'white' , ")
				if plot_utils.isSubWfJob(job_stat_det['name']):
					job_info += ( "\"sub_wf\":1 , "  )
					corresponding_dax =''
					if (self.job_instance_id_sub_wf_uuid_map.has_key(job_stat_det['instance_id'])): 
						corresponding_dax = self.job_instance_id_sub_wf_uuid_map[job_stat_det['instance_id']]
						job_info += ( "\"sub_wf_name\":\""+ corresponding_dax+ "." + extn +"\"")
					else:
						job_info += ( "\"sub_wf_name\":''")	
						
				else:
					job_info += ( "\"sub_wf\":0 , " )	
					job_info += ( "\"sub_wf_name\":''")
				job_info +=( "\n\t},\n")
			host_info+= job_info
			host_info += "]},"	
		return host_info
Exemple #3
0
    def get_formatted_job_data(self, extn="html"):
        """
		Returns formatted job information data.
		"""
        # find the pretty print length
        job_info = ''
        for job_stat in self.job_statistics_list:
            job_stat_det = job_stat.getJobDetails(self.dagman_start_time)
            job_info += ("{")
            job_info += ("\n")
            job_info += ("\"name\":" + "\"" + job_stat_det['name'] + "\" , ")
            job_info += ("\"jobS\":" + job_stat_det['jobS'] + " , ")
            job_info += ("\"jobD\":" + job_stat_det['jobD'] + " , ")
            job_info += ("\"preS\":" + job_stat_det['preS'] + " , ")
            job_info += ("\"preD\":" + job_stat_det['preD'] + " , ")
            job_info += ("\"cS\":" + job_stat_det['cS'] + " , ")
            job_info += ("\"cD\":" + job_stat_det['cD'] + " , ")
            job_info += ("\"gS\":" + job_stat_det['gS'] + " , ")
            job_info += ("\"gD\":" + job_stat_det['gD'] + " , ")
            job_info += ("\"eS\":" + job_stat_det['eS'] + " , ")
            job_info += ("\"eD\":" + job_stat_det['eD'] + " , ")
            job_info += ("\"kS\":" + job_stat_det['kS'] + " , ")
            job_info += ("\"kD\":" + job_stat_det['kD'] + " , ")
            job_info += ("\"postS\":" + job_stat_det['postS'] + " , ")
            job_info += ("\"postD\":" + job_stat_det['postD'] + " , ")
            job_info += ("\"state\":" + job_stat_det['state'] + " , ")
            job_info += ("\"transformation\": \"" +
                         job_stat_det['transformation'] + "\"  , ")
            if self.transformation_color_map.has_key(
                    job_stat_det['transformation']):
                job_info += ("\"color\": \"" + self.transformation_color_map[
                    job_stat_det['transformation']] + "\"  , ")
            else:
                # there is no compute task
                job_info += ("\"color\": 'white' , ")
            if plot_utils.isSubWfJob(job_stat_det['name']):
                job_info += ("\"sub_wf\":1 , ")
                corresponding_dax = ''
                if (self.job_instance_id_sub_wf_uuid_map.has_key(
                        job_stat_det['instance_id'])):
                    corresponding_dax = self.job_instance_id_sub_wf_uuid_map[
                        job_stat_det['instance_id']]
                    job_info += ("\"sub_wf_name\":\"" + corresponding_dax +
                                 "." + extn + "\"")
                else:
                    job_info += ("\"sub_wf_name\":''")

            else:
                job_info += ("\"sub_wf\":0 , ")
                job_info += ("\"sub_wf_name\":''")
            job_info += ("},\n")
        return job_info
	def get_formatted_job_data(self ,extn ="html" ):
		"""
		Returns formatted job information data.
		"""
		# find the pretty print length
		job_info = ''
		for job_stat in self.job_statistics_list:
			job_stat_det = job_stat.getJobDetails(self.dagman_start_time)
			job_info +=("{")
			job_info +=( "\n")
			job_info += ( "\"name\":"  + "\"" + job_stat_det['name']+ "\" , ")
			job_info += ( "\"jobS\":" +  job_stat_det['jobS'] +" , ")
			job_info += ( "\"jobD\":" +  job_stat_det['jobD'] +" , ")
			job_info += ( "\"preS\":" +  job_stat_det['preS'] +" , ")
			job_info += ( "\"preD\":" +  job_stat_det['preD'] +" , ")
			job_info += ( "\"cS\":"  +  job_stat_det['cS'] +" , ")
			job_info += ( "\"cD\":"    +  job_stat_det['cD']  +" , ")
			job_info += ( "\"gS\":"    +  job_stat_det['gS']  +" , ")
			job_info += ( "\"gD\":"    +  job_stat_det['gD']  +" , ")
			job_info += ( "\"eS\":"    +  job_stat_det['eS']  +" , ")
			job_info += ( "\"eD\":"    +  job_stat_det['eD']  +" , ")
			job_info += ( "\"kS\":"    +  job_stat_det['kS']  +" , ")
			job_info += ( "\"kD\":"    +  job_stat_det['kD']  +" , ")
			job_info += ( "\"postS\":" +  job_stat_det['postS'] +" , ")
			job_info += ( "\"postD\":" +  job_stat_det['postD'] +" , ")
			job_info += ( "\"state\":" +  job_stat_det['state'] +" , ")
			job_info += ( "\"transformation\": \"" +  job_stat_det['transformation'] +"\"  , ")
			if self.transformation_color_map.has_key(job_stat_det['transformation']):
				job_info += ( "\"color\": \"" +  self.transformation_color_map[job_stat_det['transformation']] +"\"  , ")
			else:
				# there is no compute task
				job_info += ( "\"color\": 'white' , ")
			if plot_utils.isSubWfJob(job_stat_det['name']):
				job_info += ( "\"sub_wf\":1 , "  )
				corresponding_dax =''
				if (self.job_instance_id_sub_wf_uuid_map.has_key(job_stat_det['instance_id'])): 
					corresponding_dax = self.job_instance_id_sub_wf_uuid_map[job_stat_det['instance_id']]
					job_info += ( "\"sub_wf_name\":\""+ corresponding_dax+ "." + extn+"\"")
				else:
					job_info += ( "\"sub_wf_name\":''")	
					
			else:
				job_info += ( "\"sub_wf\":0 , " )	
				job_info += ( "\"sub_wf_name\":''")
			job_info +=( "},\n")
		return job_info