Changeset 31 for trunk/daemon


Ignore:
Timestamp:
04/01/05 13:31:53 (19 years ago)
Author:
bastiaans
Message:

daemon/togad.py:

Bug was caused by incorrect timestamping

  • Now host reporting time is used

New bug: when a ganglia monitor has a big interval
it will report the same value for a second xmlthread run.

  • One cannot update an rrd twice with the same timestamp
  • Will have to check timestamp of metrics each run

This implicates that for every metric for every host the
timestamp of the last xml run must be kept in memory

  • Might as well rewrite rrd code with in-memory metric storage
  • And do scheduled/queued rrd updates, in stead of every xml run: big performance increase
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/daemon/togad.py

    r30 r31  
    1818# <=9  = RRD activity,gmetad config parsing
    1919# <=8  = host processing
    20 # <=7  = daemon threading
     20# <=7  = daemon threading - NOTE: Daemon will 'halt on all errors' from this level
    2121#
    2222DEBUG_LEVEL = 8
     
    9696                        myMetric['name'] = attrs.get('NAME',"")
    9797                        myMetric['val'] = attrs.get('VAL',"")
    98                         myMetric['time'] = self.time
     98                        myMetric['time'] = self.hostReported
    9999                        myMetric['type'] = attrs.get('TYPE',"")
    100100
     
    117117                        correct_serial = self.rrd.checkNewRrdPeriod( self.hostName, mytime )
    118118
    119                         debug_msg( 8, 'time %s: Storing metrics for %s' %(mytime, self.hostName) )
     119                        #debug_msg( 8, 'time %s: Storing metrics for %s' %(mytime, self.hostName) )
     120                        print 'Storing metrics for %s:' %(self.hostName),
    120121                        self.storeMetrics( self.hostName, correct_serial )
    121122
     
    128129
    129130                                self.rrd.createCheck( hostname, metric, timeserial )   
     131                                print ' [%s.%s]' %(metric['name'], metric['time']),
    130132                                self.rrd.update( hostname, metric, timeserial )
    131133                                debug_msg( 9, 'stored metric %s for %s: %s' %( hostname, metric['name'], metric['val'] ) )
    132134                                #sys.exit(1)
     135                print
    133136       
    134137
Note: See TracChangeset for help on using the changeset viewer.