Changeset 185 for trunk/plugin/togap.py
- Timestamp:
- 08/04/05 09:59:56 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/plugin/togap.py
r184 r185 26 26 # 27 27 #GMOND_CONF = '/etc/gmond.conf' 28 29 # Wether or not to detect differences in 30 # time from Torque server and local time. 31 # 32 # Ideally both machines (if not the same) 33 # should have the same time (via ntp or whatever) 34 # 35 DETECT_TIME_DIFFS = 1 28 36 29 37 from PBSQuery import PBSQuery … … 127 135 128 136 self.jobs = { } 137 self.timeoffset = 0 129 138 self.dp = DataProcessor() 130 139 self.initPbsQuery() … … 219 228 if nodeslist.count( host ) == 0: 220 229 nodeslist.append( host ) 230 231 if DETECT_TIME_DIFFS: 232 233 # If a job start if later than our current date, 234 # that must mean the Torque server's time is later 235 # than our local time. 236 237 if int(start_timestamp) > int( int(self.cur_time) + int(self.timeoffset) ): 238 239 self.timeoffset = int( int(start_timestamp) - int(self.cur_time) ) 221 240 222 241 elif status == 'Q': … … 254 273 myAttrs['status'] = status 255 274 myAttrs['start_timestamp'] = start_timestamp 256 myAttrs['reported'] = str( int( self.cur_time) )275 myAttrs['reported'] = str( int( int( self.cur_time ) + int( self.timeoffset ) ) ) 257 276 myAttrs['nodes'] = nodeslist 258 277 myAttrs['domain'] = string.join( socket.getfqdn().split( '.' )[1:], '.' ) … … 277 296 """Submit job info list""" 278 297 279 self.dp.multicastGmetric( 'TOGA-HEARTBEAT', str( int( self.cur_time) ) )298 self.dp.multicastGmetric( 'TOGA-HEARTBEAT', str( int( int( self.cur_time ) + int( self.timeoffset ) ) ) ) 280 299 281 300 # Now let's spread the knowledge
Note: See TracChangeset
for help on using the changeset viewer.