Changeset 53
- Timestamp:
- 04/08/05 09:39:01 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/daemon/togad.py
r52 r53 87 87 last_update = 0 88 88 89 debug_msg( 8, self.binary + ' info "' + filename + '"' ) 90 89 91 for line in os.popen( self.binary + ' info "' + filename + '"' ).readlines(): 90 92 … … 377 379 # Store metrics somewhere between every 60 and 180 seconds 378 380 # 379 #STORE_INTERVAL = random.randint( 360, 640 ) 380 STORE_INTERVAL = random.randint( 90, 120 ) 381 STORE_INTERVAL = random.randint( 360, 640 ) 381 382 382 383 storethread = threading.Thread( None, self.storeThread, 'storemetricthread' ) … … 593 594 self.myMetrics[ host ][ metric['name'] ] = [ ] 594 595 595 # Ah, psst, push it596 # <ATOMIC> 596 597 # 597 # <atomic>598 598 self.slot.acquire() 599 599 … … 601 601 602 602 self.slot.release() 603 # </atomic> 603 # 604 # </ATOMIC> 604 605 605 606 def makeUpdateList( self, host, metriclist ): … … 610 611 while len( metriclist ) > 0: 611 612 612 # Kabouter pop 613 # 614 # <atomic> 615 #self.slot.acquire() 616 617 # len might have changed since loop start 618 # 619 if len( metriclist ) > 0: 620 metric = metriclist.pop( 0 ) 621 622 #self.slot.release() 623 # </atomic> 624 625 if metric: 626 if self.checkStoreMetric( host, metric ): 627 update_list.append( '%s:%s' %( metric['time'], metric['val'] ) ) 613 metric = metriclist.pop( 0 ) 614 615 if self.checkStoreMetric( host, metric ): 616 update_list.append( '%s:%s' %( metric['time'], metric['val'] ) ) 628 617 629 618 return update_list … … 668 657 for metricname, mymetric in mymetrics.items(): 669 658 670 # Atomic: Don't want other threads messing around now 659 metrics_to_store = [ ] 660 661 # <ATOMIC> 671 662 # 672 663 self.slot.acquire() 673 664 665 while len( mymetric ) > 0: 666 667 metrics_to_store.append( mymetric.pop( 0 ) ) 668 669 self.slot.release() 670 # 671 # </ATOMIC> 672 674 673 # Create a mapping table, each metric to the period where it should be stored 675 674 # 676 metric_serial_table = self.determineSerials( hostname, metricname, m ymetric)675 metric_serial_table = self.determineSerials( hostname, metricname, metrics_to_store ) 677 676 self.myMetrics[ hostname ][ metricname ] = [ ] 678 679 self.slot.release() # Atomic end680 677 681 678 update_rets = [ ]
Note: See TracChangeset
for help on using the changeset viewer.