def fillJobProgess(self,job,selectID=None): endt = job['endt'] jobstat = job['jobStatus'] if selectID == None: if utils.hasParam("taskID"): selectID = 'taskID' else: selectID = 'jobsetID' id = job[selectID] if id == None: selectID = 'The' id = ' ' h = self.histograms() time = endt for site in ('all', job['computingSite']): if site == 'all': sitekey = '%s %s jobs/hour for all sites progress' % (selectID.title(),id ) else: sitekey = '%s %s jobs/hour/site progress' % (selectID.title(),id ) if h.has_key(sitekey): esitehist = h[sitekey] else: h[sitekey] = {} esitehist = h[sitekey] if site == 'all': ekey = '%s' % jobstat else: ekey = site if esitehist.has_key(ekey): hist = esitehist[ekey] else: hist = esitehist[ekey] = PandaTimeHistogram(ekey,max=self.tendh,min=self.tstarth,step=self.tsteph) hist.fill(time)
def fillJobDuration(self,job,total_hours,selectID=None,transfer=None): duration = job['duration'] jobstat = job['jobStatus'] tostart = job['tostart'] transferPlot = transfer if jobstat in ('canceled', 'finished', 'failed') else False tkey = 'transfer' skey = 'stage out' if selectID == None: if utils.hasParam("taskID"): selectID = 'taskID' else: selectID = 'jobsetID' id = job[selectID] if id == None or id==-1: selectID = 'The' id = ' ' h = self.histograms() sitekey = "%s %s job duration for all sites " % (selectID.title(),id ) waitsitekey = "%s %s job wait time for all sites " % (selectID.title(),id ) if transferPlot: transfert = job['transfert'] transfersitekey = "%s %s job transfer time for all sites " % (selectID.title(),id ) if not h.has_key(transfersitekey): hh = { tkey:PandaHistogram(tkey,max=0.7*total_hours,min=0.001,step=0.05) , skey:PandaHistogram(tkey,max=0.7*total_hours,min=0.001,step=0.05) } for hi in hh: hh[hi].integralOpt(True) h[transfersitekey] = hh tsitehist = h[transfersitekey] time = transfert.days*24.0+float(transfert.seconds)/3600.0 tsitehist[tkey].fill(time) try: time = PilotTiming(job['pilotTiming'])['stageout'] v = time.value u = time.unitvalue*60. tsitehist[skey].fill(float(v)/u) except: pass elif not transfer: if not h.has_key(sitekey): h[sitekey] = {} if not h.has_key(waitsitekey): h[waitsitekey] = {} esitehist = h[sitekey] wsitehist = h[waitsitekey] ekey = '%s' % jobstat if not esitehist.has_key(ekey): esitehist[ekey] = PandaHistogram(ekey,max=total_hours,min=0,step=0.1) esitehist[ekey].integralOpt(True) if not wsitehist.has_key(ekey): wsitehist[ekey] = PandaHistogram(ekey,max=total_hours,min=0,step=0.1) wsitehist[ekey].integralOpt(True) dhist = esitehist[ekey] time = duration.days*24.0+float(duration.seconds)/3600.0 dhist.fill(time) whist = wsitehist[ekey] wait= tostart.days*24.0+float(tostart.seconds)/3600.0 whist.fill(wait)