Changeset 409 for trunk/jobmond
- Timestamp:
- 07/06/07 14:16:44 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/jobmond/jobmond.py
r388 r409 327 327 return incompatible 328 328 329 def multicastGmetric( self, metricname, metricval, valtype='string' ):329 def multicastGmetric( self, metricname, metricval, valtype='string', units='' ): 330 330 331 331 """Call gmetric binary and multicast""" … … 348 348 gm = Gmetric( GMETRIC_TARGET_HOST, GMETRIC_TARGET_PORT ) 349 349 350 gm.send( str( metricname ), str( metricval ), str( self.dmax ) )350 gm.send( str( metricname ), str( metricval ), str( self.dmax ), units ) 351 351 352 352 else: … … 359 359 360 360 cmd = cmd + ' -n' + str( metricname )+ ' -v"' + str( metricval )+ '" -t' + str( valtype ) + ' -d' + str( self.dmax ) 361 362 if len( units ) > 0: 363 364 cmd = cmd + ' -u"' + units + '"' 361 365 362 366 debug_msg( 10, printTime() + ' ' + cmd ) … … 776 780 self.dp.multicastGmetric( 'MONARCH-HEARTBEAT', str( int( int( self.cur_time ) + int( self.timeoffset ) ) ) ) 777 781 782 running_jobs = 0 783 queued_jobs = 0 784 785 for jobid, jobattrs in self.jobs.items(): 786 787 if jobattrs[ 'status' ] == 'Q': 788 789 queued_jobs += 1 790 791 elif jobattrs[ 'status' ] == 'R': 792 793 running_jobs += 1 794 795 self.dp.multicastGmetric( 'MONARCH-RJ', str( running_jobs ), 'uint32', 'jobs' ) 796 self.dp.multicastGmetric( 'MONARCH-QJ', str( queued_jobs ), 'uint32', 'jobs' ) 797 778 798 # Now let's spread the knowledge 779 799 # … … 922 942 return 'udp' 923 943 924 def send( self, name, value, dmax ): 925 926 msg = self.makexdr( name, value, self.type, self.unitstr, self.slopestr, self.tmax, dmax ) 944 def send( self, name, value, dmax, units = '' ): 945 946 if len( units ) == 0: 947 units = self.unitrs 948 949 msg = self.makexdr( name, value, self.type, units, self.slopestr, self.tmax, dmax ) 927 950 928 951 return self.socket.sendto( msg, self.hostport )
Note: See TracChangeset
for help on using the changeset viewer.