ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/CRAB/python/apmon.py
(Generate patch)

Comparing COMP/CRAB/python/apmon.py (file contents):
Revision 1.6 by corvo, Tue Apr 4 16:14:13 2006 UTC vs.
Revision 1.7 by slacapra, Fri Mar 28 17:18:46 2008 UTC

# Line 177 | Line 177 | class ApMon:
177                  self.configRecheck = True           # enabled by default
178                  self.performBgMonitoring = True     # by default, perform background monitoring
179                  self.monitoredJobs = {}             # Monitored jobs; key = pid; value = hash with
180 <                self.maxMsgRate = 10                # Maximum number of messages allowed to be sent per second
180 >                self.maxMsgRate = 100               # Maximum number of messages allowed to be sent per second
181                  self.__defaultSenderRef = {'INSTANCE_ID': random.randint(0,0x7FFFFFFE), 'SEQ_NR': 0};
182                  self.__defaultUserCluster = "ApMon_UserSend";
183                  self.__defaultUserNode = socket.getfqdn();
# Line 199 | Line 199 | class ApMon:
199                  self.__prvDrop = 0;
200                  self.__crtSent = 0;
201                  self.__crtDrop = 0;
202 <                self.__hWeight = 0.92;
202 >                self.__hWeight = 0.95;              # in (0,1) increase to wait more time before maxMsgRate kicks-in
203                  self.logger = Logger.Logger(defaultLogLevel)
204                  self.setDestinations(initValue)
205                  self.__udpSocket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
206 < #               if len(self.configAddresses) > 0:
207 <                        # if there are addresses that need to be monitored,
208 <                        # start config checking and reloading thread
209 < #                       th = threading.Thread(target=self.__configLoader)
210 < #                       th.setDaemon(True)  # this is a daemon thread
211 < #                       th.start()
206 >                #if len(self.configAddresses) > 0:
207 >                #       # if there are addresses that need to be monitored,
208 >                #       # start config checking and reloading thread
209 >                #       th = threading.Thread(target=self.__configLoader)
210 >                #       th.setDaemon(True)  # this is a daemon thread
211 >                #       th.start()
212                  # create the ProcInfo instance
213                  self.procInfo = ProcInfo.ProcInfo(self.logger);
214                  # self.procInfo.update();
215                  # start the background monitoring thread
216 < #               th = threading.Thread(target=self.__bgMonitor);
217 < #               th.setDaemon(True);
218 < #               th.start();
216 >                #th = threading.Thread(target=self.__bgMonitor);
217 >                #th.setDaemon(True);
218 >                #th.start();
219  
220          def sendParams (self, params):
221                  """
# Line 430 | Line 430 | class ApMon:
430                  Stop background threands, close opened sockets. You have to use this function if you want to
431                  free all the resources that ApMon takes, and allow it to be garbage-collected.
432                  """
433 < #               if len(self.configAddresses) > 0:
434 < #                       self.__configUpdateEvent.set()
435 < #                       self.__configUpdateFinished.wait()
436 < #               self.__bgMonitorEvent.set()
437 < #               self.__bgMonitorFinished.wait()
433 >                #if len(self.configAddresses) > 0:
434 >                #       self.__configUpdateEvent.set()
435 >                #       self.__configUpdateFinished.wait()
436 >                #self.__bgMonitorEvent.set()
437 >                #self.__bgMonitorFinished.wait()
438                  
439                  if self.__udpSocket != None:
440                          self.logger.log(Logger.DEBUG, "Closing UDP socket on ApMon object destroy.");
# Line 693 | Line 693 | class ApMon:
693          def __directSendParams (self, destination, clusterName, nodeName, timeStamp, params):
694                  
695                  if self.__shouldSend() == False:
696 <                        self.logger.log(Logger.DEBUG, "Dropping packet since rate is too fast!");
697 <                        return;
696 > #                       self.logger.log(Logger.ERROR, "Dropping packet since rate is too fast!");
697 >                        self.logger.log(Logger.INFO, "Pausing 1sec since rate is too fast!");
698 >                        time.sleep(1.0)
699 > #                       return;
700                  
701                  if destination == None:
702                          self.logger.log(Logger.WARNING, "Destination is None");

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines