Changeset 80


Ignore:
Timestamp:
04/18/05 10:42:27 (17 years ago)
Author:
bastiaans
Message:

plugin/togap.py:

  • Added a 'poll_interval' value for helping determine end of job on server side
  • Rewrote compileGmetricVal() for readability
  • Changed -x to -d (DMAX is the real timeout value for a metric)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/plugin/togap.py

    r76 r80  
    4040                        self.binary = binary
    4141
    42                 self.tmax = str( TORQUE_POLL_INTERVAL )
     42                # Timeout for XML
     43                #
     44                # From ganglia's documentation:
     45                #
     46                # 'A metric will be deleted DMAX seconds after it is received, and
     47                # DMAX=0 means eternal life.'
     48
     49                self.dmax = str( int( TORQUE_POLL_INTERVAL ) - 1 )
    4350
    4451                try:
     
    102109                        debug_msg( 10, 'Assuming /etc/gmond.conf for gmetric cmd (ommitting)' )
    103110
    104                 cmd = cmd + ' -n' + str( metricname )+ ' -v"' + str( metricval )+ '" -t' + str( valtype ) + ' -x' + str( self.tmax )
     111                cmd = cmd + ' -n' + str( metricname )+ ' -v"' + str( metricval )+ '" -t' + str( valtype ) + ' -d' + str( self.dmax )
    105112
    106113                print cmd
     
    201208                        myAttrs['nodes'] = nodeslist
    202209                        myAttrs['domain'] = string.join( socket.getfqdn().split( '.' )[1:], '.' )
     210                        myAttrs['poll_interval'] = TORQUE_POLL_INTERVAL
    203211
    204212                        if self.jobDataChanged( jobs, job_id, myAttrs ):
     
    249257                """Create a val string for gmetric of jobinfo"""
    250258
    251                 name_str = 'name=' + jobattrs['name']
    252                 queue_str = 'queue=' + jobattrs['queue']
    253                 owner_str = 'owner=' + jobattrs['owner']
    254                 rtime_str = 'requested_time=' + jobattrs['requested_time']
    255                 rmem_str = 'requested_memory=' + jobattrs['requested_memory']
    256                 ppn_str = 'ppn=' + jobattrs['ppn']
    257                 status_str = 'status=' + jobattrs['status']
    258                 stime_str = 'start_timestamp=' + jobattrs['start_timestamp']
    259                 reported_str = 'reported=' + jobattrs['reported']
    260                 domain_str = 'domain=' + jobattrs['domain']
    261                 node_str = 'nodes=' + self.makeNodeString( jobattrs['nodes'] )
    262 
    263                 appendList = [ name_str, queue_str, owner_str, rtime_str, rmem_str, ppn_str, status_str, stime_str, reported_str, domain_str, node_str ]
     259                appendList = [ ]
     260                appendList.append( 'name=' + jobattrs['name'] )
     261                appendList.append( 'queue=' + jobattrs['queue'] )
     262                appendList.append( 'owner=' + jobattrs['owner'] )
     263                appendList.append( 'requested_time=' + jobattrs['requested_time'] )
     264                appendList.append( 'requested_memory=' + jobattrs['requested_memory'] )
     265                appendList.append( 'ppn=' + jobattrs['ppn'] )
     266                appendList.append( 'status=' + jobattrs['status'] )
     267                appendList.append( 'start_timestamp=' + jobattrs['start_timestamp'] )
     268                appendList.append( 'reported=' + jobattrs['reported'] )
     269                appendList.append( 'poll_interval=' + jobattrs['poll_interval'] )
     270                appendList.append( 'domain=' + jobattrs['domain'] )
     271                appendList.append( 'nodes=' + self.makeNodeString( jobattrs['nodes'] ) )
    264272
    265273                return self.makeAppendLists( appendList )
Note: See TracChangeset for help on using the changeset viewer.