Changeset 409 for trunk/jobmond


Ignore:
Timestamp:
07/06/07 14:16:44 (14 years ago)
Author:
bastiaans
Message:

web/addons/job_monarch/version.php:

  • SVN version

web/addons/job_monarch/libtoga.php:

  • need $start in my graph.php

jobmond/jobmond.py:

  • added number of running and queued jobs metric reporting

web/addons/job_monarch/graph.php:

  • added 'job_report' graph, shows running and queued jobs

web/addons/job_monarch/overview.php:

  • included IMG to job_report graph

web/addons/job_monarch/index.php:

  • added range menu
  • fixed metric_menu selection now properly instantly refreshes graphs

web/addons/job_monarch/templates/overview.tpl:

  • added job_report graph
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/jobmond/jobmond.py

    r388 r409  
    327327                return incompatible
    328328
    329         def multicastGmetric( self, metricname, metricval, valtype='string' ):
     329        def multicastGmetric( self, metricname, metricval, valtype='string', units='' ):
    330330
    331331                """Call gmetric binary and multicast"""
     
    348348                        gm = Gmetric( GMETRIC_TARGET_HOST, GMETRIC_TARGET_PORT )
    349349
    350                         gm.send( str( metricname ), str( metricval ), str( self.dmax ) )
     350                        gm.send( str( metricname ), str( metricval ), str( self.dmax ), units )
    351351
    352352                else:
     
    359359
    360360                        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 + '"'
    361365
    362366                        debug_msg( 10, printTime() + ' ' + cmd )
     
    776780                self.dp.multicastGmetric( 'MONARCH-HEARTBEAT', str( int( int( self.cur_time ) + int( self.timeoffset ) ) ) )
    777781
     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
    778798                # Now let's spread the knowledge
    779799                #
     
    922942                        return 'udp'
    923943
    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 )
    927950
    928951                return self.socket.sendto( msg, self.hostport )
Note: See TracChangeset for help on using the changeset viewer.