ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/CRAB/python/ApmonIf.py
Revision: 1.6
Committed: Mon Mar 20 16:17:50 2006 UTC (19 years, 1 month ago) by corvo
Content type: text/x-python
Branch: MAIN
CVS Tags: CRAB_1_0_7, CRAB_1_0_7_pre1
Changes since 1.5: +3 -3 lines
Log Message:
ML Server name fix

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://lxgate35.cern.ch:40808/ApMonConf'):
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://lxgate35.cern.ch:40808/ApMonConf'
25 print "Creating ApMon with " + apmonUrl
26 apmonInstance = apmon.ApMon(apmonUrl)
27 return apmonInstance
28
29 def free(self):
30 self.apm.free()