Package Ganga :: Package Lib :: Package MonitoringServices :: Package ARDADashboard :: Package LCG :: Module ARDADashboardLCGAthena
[hide private]
[frames] | no frames]

Source Code for Module Ganga.Lib.MonitoringServices.ARDADashboard.LCG.ARDADashboardLCGAthena

  1  from Ganga.Lib.MonitoringServices.ARDADashboard.LCG.ARDADashboardLCG import ARDADashboardLCG 
  2  from types import DictionaryType, IntType 
  3   
4 -class ARDADashboardLCGAthena(ARDADashboardLCG):
5 6 application = 'unknown' 7 applicationVersion = 'unknown' 8 dataset = 'unknown' 9 activity = 'unknown' 10
11 - def __init__(self, job_info):
12 13 ARDADashboardLCG.__init__(self, job_info) 14 if self._complete == False: 15 return 16 17 self._complete = False 18 if type(job_info) is DictionaryType: 19 # we are on the worker node 20 try: 21 self.application = job_info['application'] 22 self.applicationVersion = job_info['applicationVersion'] 23 self.dataset = job_info['dataset'][0] 24 self.activity = job_info['activity'] 25 self._complete = True 26 except KeyError,msg: 27 return 28 29 else: 30 # we are on the client. We get the info from the job_info 31 # (which is a job) 32 33 job = job_info 34 35 self.application = job.application._name 36 37 try: 38 self.applicationVersion = job.application.atlas_release 39 except AttributeError: 40 self.applicationVersion = '' 41 42 43 # activity 44 if self.application in ['Athena', 'AthenaMC', 'AMAAthena']: 45 self.activity = 'analysis' 46 else: 47 activity = 'unknown' 48 49 # dataset name 50 try: 51 self.dataset = job.inputdata.dataset[0] 52 except AttributeError: 53 self.dataset = 'unknown' 54 except IndexError: 55 self.dataset = 'unknown' 56 57 self._complete = True
58
59 - def getSandboxModules(self):
62
63 - def getJobInfo(self):
64 if self._complete: 65 job_info = ARDADashboardLCG.getJobInfo(self) 66 job_info['application'] = self.application 67 job_info['applicationVersion'] = self.applicationVersion 68 job_info['dataset'] = self.dataset 69 job_info['activity'] = self.activity 70 self._logger.debug(job_info) 71 return job_info 72 else: 73 self._logger.debug('incomplete job info') 74 return {}
75
76 - def submit(self, **opts):
77 78 if self._complete: 79 try: 80 self._logger.debug("sending to the monalisa server") 81 self.dashboard.sendValues(message = { 82 'Application':self.application, 83 'ApplicationVersion':self.applicationVersion, 84 'DatasetName':self.dataset, 85 'GridJobID':self.gridJobId, 86 'GridUser':self.gridCertificate, 87 'JSTool':'ganga', 88 'Scheduler':self.gridBackend, 89 'TaskType':self.activity, 90 'VO':self.VO 91 }, 92 jobId=self.gangaJobId + '_' + self.gridJobId, 93 taskId=self.gangaTaskId 94 ) 95 self._logger.debug("sent to the monalisa server") 96 except Exception,msg: 97 self._logger.debug('could not send monalisa message: %s' % msg) 98 else: 99 self._logger.debug('did not send the monitoring message because the job is not complete')
100