Esempio n. 1
0
	def updateInfoFromSuccessFulExecution(self, whetstones, queueTime, bandwidth):
		if self.successfulExecutions == 0:
			self.whetstones = whetstones			
			if bandwidth > 0:
				self.bandwidth = bandwidth
		else:
			
			oldWhetstones = self.whetstones
			newWhetstones = Bessel.calculateAverage(oldWhetstones, self.successfulExecutions, whetstones)	
			self.whetstones = newWhetstones
			
			if bandwidth > 0:
				oldBandwidth = self.bandwidth
				newBandwidth = Bessel.calculateAverage(oldBandwidth, self.successfulExecutions, bandwidth)
				self.bandwidth = newBandwidth
			
		self.successfulExecutions +=1
		self.failedProfilings -=1
Esempio n. 2
0
	def updateInfoAfterProfiling(self, constantEffort, sampleEffort):
		
		if (self.numProfilings == 0):
			self.constantEffort = constantEffort
			self.sampleEffort = sampleEffort
			
			
		else:
			oldConstantEffort = self.constantEffort
			newConstantEffort = Bessel.calculateAverage(oldConstantEffort, self.numProfilings, constantEffort)
			
			
			oldSampleEffort = self.sampleEffort
			newSampleEffort = Bessel.calculateAverage(oldSampleEffort, self.numProfilings, sampleEffort)
				
			self.constantEffort = newConstantEffort
			self.sampleEffort = newSampleEffort
			
		self.numProfilings += 1
Esempio n. 3
0
	def updateInfoFromSuccessFulExecution(self, whetstones, queueTime, bandwidth):

		if self.successfulExecutions == 0:
			self.whetstones = whetstones
			self.whetstonesTypicalDeviation = 0
			
			self.queueTime = queueTime
			self.queueTimeTypicalDeviation= 0
			
			if bandwidth > 0:
				self.bandwidth = bandwidth
		else:
			
			oldWhetstones = self.whetstones
			newWhetstones = Bessel.calculateAverage(oldWhetstones, self.successfulExecutions, whetstones)
	
			oldWhetstonesDeviation = self.whetstonesTypicalDeviation
			newWhetstonesDeviation = Bessel.calculateTypicalDeviation(oldWhetstones, oldWhetstonesDeviation, self.successfulExecutions, whetstones)
	
			self.whetstones = newWhetstones
			self.whetstonesTypicalDeviation = newWhetstonesDeviation
			
			oldQueueTime = self.queueTime
			newQueueTime = Bessel.calculateAverage(oldQueueTime, self.successfulExecutions, queueTime)
	
			oldQueueTimeDeviation = self.queueTimeTypicalDeviation
			newQueueTimeDeviation = Bessel.calculateTypicalDeviation(oldQueueTime, oldQueueTimeDeviation, self.successfulExecutions, queueTime)
	
			self.queueTime = newQueueTime
			self.queueTimeTypicalDeviation = newQueueTimeDeviation
			
			if bandwidth > 0:
				oldBandwidth = self.bandwidth
				newBandwidth = Bessel.calculateAverage(oldBandwidth, self.successfulExecutions, bandwidth)
				self.bandwidth = newBandwidth
			
		self.successfulExecutions +=1
		
		#si ha funcionado una tarea ponemos el contador de fallos a 0, para que el sitio no sea baneado
		#(y si han fucionado más de una, pues negativo)
		self.failedProfilings =max (0, self.failedProfilings -1)
		print ("	failed profilings: " + str(self.failedProfilings) + " on host " + self.hostname)