ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/CRAB/python/ApmonIf.py
Revision: 1.3
Committed: Tue Nov 8 16:03:22 2005 UTC (19 years, 5 months ago) by corvo
Content type: text/x-python
Branch: MAIN
CVS Tags: CRAB_1_0_3, CRAB_1_0_2, CRAB_0_2_2
Changes since 1.2: +1 -1 lines
Log Message:
Fixed bugs on ML instance

File Contents

# Content
1 import apmon
2
3 class ApmonIf:
4 """
5 Provides an interface to the Monalisa Apmon python module
6 """
7 def __init__(self, address='http://monalisa.cern.ch/ARDA/apmon.cms'):
8 self._params = {}
9 self._MLaddress = address
10 self.apm = None
11 self.apm = self.getApmonInstance()
12
13 def fillDict(self, parr):
14 """
15 Used to fill the dictionary of key/value pair and instantiate the ML client
16 """
17 self._params = parr
18
19 def sendToML(self):
20 self.apm.sendParameters(self._params['taskId'], self._params['jobId'], self._params)
21
22 def getApmonInstance(self):
23 if self.apm is None :
24 apmonUrl = 'http://www-asap.cern.ch/ml-conf/apmon.cms'
25 print "Creating ApMon with " + apmonUrl
26 apmonInstance = apmon.ApMon(apmonUrl)
27 return apmonInstance