Changeset 55


Ignore:
Timestamp:
04/08/05 15:16:43 (17 years ago)
Author:
bastiaans
Message:

daemon/togad.py:

Multiple storethreads is of no use: Both threads will do the exact same thing
instead of sharing the work.

  • Would need to thread the rrd-commands, will require more coding
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/daemon/togad.py

    r54 r55  
    2323# 7  = daemon threading
    2424#
    25 DEBUG_LEVEL = 8
     25DEBUG_LEVEL = 7
    2626
    2727# Where is the gmetad.conf located
     
    6363STORE_TIMEOUT = 360
    6464
    65 # Number of storing threads
    66 #
    67 STORE_THREADS = 1
    6865"""
    6966This is TOrque-GAnglia's data Daemon
     
    352349
    353350                xmlthread = threading.Thread( None, self.processXML, 'xmlthread' )
    354 
    355                 storethreads = [ ]
    356 
    357                 for num in range( int( STORE_THREADS ) ):
    358 
    359                         storethreads.append( threading.Thread( None, self.storeMetrics, 'storethread' ) )
     351                storethread = threading.Thread( None, self.storeMetrics, 'storethread' )
    360352
    361353                while( 1 ):
     
    369361                                xmlthread.start()
    370362
    371                         for storethread in storethreads:
    372 
    373                                 mythread = storethreads.index( storethread )
    374 
    375                                 if not storethread.isAlive():
    376 
    377                                         # Store metrics every .. sec
    378 
    379                                         # threaded call to: self.storeMetrics()
    380                                         #
    381                                         storethreads[ mythread ] = threading.Thread( None, self.storeMetrics, 'storethread' )
    382                                         storethreads[ mythread ].start()
     363                        if not storethread.isAlive():
     364                                # Store metrics every .. sec
     365
     366                                # threaded call to: self.storeMetrics()
     367                                #
     368                                storethread = threading.Thread( None, self.storeMetrics, 'storethread' )
     369                                storethread.start()
    383370               
    384371                        # Just sleep a sec here, to prevent daemon from going mad. We're all threads here anyway
     
    392379                # Store metrics somewhere between every 60 and 180 seconds
    393380                #
    394                 #STORE_INTERVAL = random.randint( 360, 640 )
    395                 STORE_INTERVAL = 60
     381                STORE_INTERVAL = random.randint( 360, 640 )
    396382
    397383                storethread = threading.Thread( None, self.storeThread, 'storemetricthread' )
Note: See TracChangeset for help on using the changeset viewer.