Changeset 67
- Timestamp:
- 04/14/05 12:53:04 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/plugin/togap.py
r66 r67 20 20 import time 21 21 import os 22 import socket 22 23 import string 23 24 … … 133 134 134 135 for name, attrs in joblist.items(): 136 137 print attrs 135 138 136 139 job_id = name.split( '.' )[0] … … 150 153 status = self.getAttr( attrs, 'job_state' ) 151 154 start_timestamp = self.getAttr( attrs, 'mtime' ) 152 #stop_timestamp = '' 155 156 nodes = self.getAttr( attrs, 'exec_host' ).split( '+' ) 157 nodeslist = [ ] 158 159 for node in nodes: 160 host = node.split( '/' )[0] 161 162 if nodeslist.count( host ) == 0: 163 nodeslist.append( node.split( '/' )[0] ) 153 164 154 165 myAttrs = { } … … 161 172 myAttrs['status'] = status 162 173 myAttrs['start_timestamp'] = start_timestamp 163 #myAttrs['stop_timestamp'] = stop_timestamp 174 myAttrs['nodes'] = nodeslist 175 myAttrs['domain'] = string.join( socket.getfqdn().split( '.' )[1:], '.' ) 164 176 165 177 if self.jobDataChanged( jobs, job_id, myAttrs ): … … 169 181 170 182 debug_msg( 10, printTime() + ' job %s state changed' %(job_id) ) 171 172 #for id, attrs in jobs.items():173 174 # # This job was there in the last run, and not anymore175 # # it must have finished176 177 # if id not in jobs_processed and attrs['stop_timestamp'] == '':178 179 # jobs[ id ]['status'] = 'F'180 # jobs[ id ]['stop_timestamp'] = time.time()181 # debug_msg( 10, printTime() + ' job %s finished' %(id) )182 # self.printJob( jobs, id )183 183 184 184 return jobs … … 199 199 for val in gmetric_val: 200 200 self.dp.multicastGmetric( 'TOGA-JOB-' + jobid, val ) 201 202 def makeNodeString( self, nodelist ): 203 204 node_str = None 205 206 for node in nodelist: 207 if not node_str: 208 node_str = node 209 else: 210 node_str = node_str + ';' + node 211 212 return node_str 201 213 202 214 def compileGmetricVal( self, jobid, jobattrs ): … … 211 223 status_str = 'status=' + jobattrs['status'] 212 224 stime_str = 'stime=' + jobattrs['start_timestamp'] 213 214 appendList = [ name_str, queue_str, owner_str, rtime_str, rmem_str, ppn_str, status_str, stime_str ] 225 domain_str = 'domain=' + jobattrs['domain'] 226 node_str = 'nodes=' + self.makeNodeString( jobattrs['nodes'] ) 227 228 appendList = [ name_str, queue_str, owner_str, rtime_str, rmem_str, ppn_str, status_str, stime_str, domain_str, node_str ] 215 229 216 230 return self.makeAppendLists( appendList )
Note: See TracChangeset
for help on using the changeset viewer.