def calculateThroughput(self, result_set): base = result_set[0] lastSubmissionTime = result_set[len(result_set)-1][1] ws = base[1] we = ws + 100 interval = 0 completedJobs = 0 cumulativeCompleted=20 data=[] cumulData=[] wsList=[] while ws <= lastSubmissionTime: completedJobs = 0 for row in result_set: if ws <= row[1] and row[1] <= we: if row[12] <= we: completedJobs += 1 # total += completedJobs data.append(completedJobs) wsList.append(we) ws = we we = ws + 100 cumulativeCompleted+=completedJobs cumulData.append(cumulativeCompleted) GnuplotUtils.plotTPut(data,wsList) GnuplotUtils.plotCumul(cumulData,wsList) return data
def analyze(self): # Get results from supplied databases workload_stats = self.getStats(self.workloadDB, 'Stats' ) # Sort statistics based on job name, so that # the two dbs are correctly aligned # workload_stats.sort(self.jobCompareName) # averageSlowdown,slowdown2 = self.calculateSlowDown2(workload_stats) workload_stats.sort(self.jobCompareSubmissionTime) slowdownOne,slowdownInf = self.calculateSlowdownOne(workload_stats) response = self.calculateResponseTimes(workload_stats) #tput = self.calculateThroughput(workload_stats) slowdown = self.calculateSlowDown(workload_stats) qwait = self.calculateQWaitTimes(workload_stats) new_result_set = self.moveStartTimeOnAxis(workload_stats) # job run times histo = CHistogram() for row in new_result_set: histo.addValue(row[13]) histo.computeCDF() self.dumpToFile(new_result_set, self.getJobExecutionTimes(workload_stats), 'exec_time.dat') self.dumpToFile(new_result_set, response, 'response.dat') self.dumpToFile(new_result_set, slowdown, 'slowdown.dat') self.dumpToFile(new_result_set, slowdownOne, 'slowdownOne.dat') self.dumpToFile(new_result_set, slowdownInf, 'slowdownInf.dat') self.dumpSlowdownToFile(new_result_set, 'slowdown2.dat') self.dumpToFile(new_result_set, qwait, 'qwait.dat') self.dumpStatisticsToFile("stats.txt", new_result_set, response , slowdown, qwait) # GnuplotUtils.plotJobStats(new_result_set) # GnuplotUtils.plotQueueWaitTime(new_result_set, qwait) # GnuplotUtils.plotResponseTimes(new_result_set, response)` GnuplotUtils.plotSlowdowns(new_result_set, slowdownOne,slowdownInf)