Ignore:
Timestamp:
07/31/13 16:33:20 (7 years ago)
Author:
ramonb
Message:

jobarchived/jobarchived.py:

  • rearranged RRDHandler's class variables to be explicitly set in constructor so that they are local to instance
  • small changes to debug messages
  • see #173
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/1.1/jobarchived/jobarchived.py

    r929 r930  
    932932        """
    933933
     934        global ARCHIVE_DATASOURCES
     935
    934936        jobinfo = { }
    935937
     
    10251027                    debug_msg( 10, 'jobinfo for job %s has changed' %jobid )
    10261028            else:
    1027                 debug_msg( 1, 'new job %s' %jobid )
     1029                debug_msg( 10, 'new job %s' %jobid )
    10281030
    10291031                if not jobid in self.jobs_to_store:
     
    11441146        """Find all existing clusters in archive dir"""
    11451147
     1148        global ARCHIVE_DATASOURCES
     1149
    11461150        archive_dir    = check_dir(ARCHIVE_PATH)
    11471151
     
    11731177                    self.clusters[ clustername ] = RRDHandler( self.config, clustername )
    11741178
    1175         debug_msg( 9, "Found "+str(len(self.clusters.keys()))+" clusters" )
     1179                    debug_msg( 9, 'Found cluster dir: %s' %( clustername ) )
     1180
     1181        debug_msg( 9, "Found "+str(len(self.clusters.keys()))+" cluster dirs" )
    11761182
    11771183    def startElement( self, name, attrs ):
    11781184        """Memorize appropriate data from xml start tags"""
    11791185
     1186        global ARCHIVE_DATASOURCES
     1187
    11801188        if name == 'GANGLIA_XML':
    11811189
     
    12011209                self.clusters[ self.clusterName ] = RRDHandler( self.config, self.clusterName )
    12021210
    1203                 debug_msg( 10, ' |-Cluster found: %s' %( self.clusterName ) )
     1211            debug_msg( 10, ' |-Cluster found: %s' %( self.clusterName ) )
    12041212
    12051213        elif name == 'HOST' and self.clusterName in ARCHIVE_DATASOURCES:     
     
    12381246                self.clusters[ self.clusterName ].memMetric( self.hostName, myMetric )
    12391247
     1248                debug_msg( 9, 'added metric %s from host %s to cluster %s' %( myMetric['name'], self.hostName, self.clusterName ) )
    12401249                debug_msg( 11, ' | | |-metric: %s:%s' %( myMetric['name'], myMetric['val'] ) )
    12411250
     
    16701679    """Class for handling RRD activity"""
    16711680
    1672     myMetrics   = { }
    1673     lastStored  = { }
    1674     timeserials = { }
    1675     slot = None
    16761681
    16771682    def __init__( self, config, cluster ):
     
    16841689        self.config  = config
    16851690        self.slot    = threading.Lock()
     1691        self.myMetrics   = { }
     1692        self.lastStored  = { }
     1693        self.timeserials = { }
    16861694
    16871695        if MODRRDTOOL:
Note: See TracChangeset for help on using the changeset viewer.