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

# User Rev Content
1 corvo 1.1 import apmon
2    
3     class ApmonIf:
4     """
5     Provides an interface to the Monalisa Apmon python module
6     """
7 corvo 1.6 def __init__(self, address='http://lxgate35.cern.ch:40808/ApMonConf'):
8 corvo 1.1 self._params = {}
9     self._MLaddress = address
10 corvo 1.2 self.apm = None
11     self.apm = self.getApmonInstance()
12 corvo 1.1
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 corvo 1.3 self.apm.sendParameters(self._params['taskId'], self._params['jobId'], self._params)
21 corvo 1.2
22     def getApmonInstance(self):
23     if self.apm is None :
24 corvo 1.6 apmonUrl = 'http://lxgate35.cern.ch:40808/ApMonConf'
25 corvo 1.2 print "Creating ApMon with " + apmonUrl
26 corvo 1.6 apmonInstance = apmon.ApMon(apmonUrl)
27 corvo 1.2 return apmonInstance
28 corvo 1.4
29     def free(self):
30     self.apm.free()