def get_tids(): tids = lock.get_tids() tidsPercent = '' totPercent = (lock.get_exclusive_stats().time(DEFAULT_NUM_CORES) * 100.0) / float(SUMMARY.get_max_work(DEFAULT_NUM_CORES)) for tid in tids.keys(): time = tids[tid] tidsPercent += '%lu:%.2f%% ' % ( tid, (time * 100.0) / lock.get_exclusive_stats().time(DEFAULT_NUM_CORES)) return tidsPercent
def get_cpus(): cpuTable = lock.get_cpus() if len(cpuTable) == 0: return '' cpus = cpuTable.keys() time = cpuTable[cpus[0]].time(DEFAULT_NUM_CORES) cpuString = '%u:%.2f%%' % (cpus[0], ( time * 100.0) / lock.get_exclusive_stats().time(DEFAULT_NUM_CORES)) for cpu in cpus[1:]: time = cpuTable[cpu].time(DEFAULT_NUM_CORES) cpuString += ' %u:%.2f%%' % ( cpu, (time * 100.0) / lock.get_exclusive_stats().time(DEFAULT_NUM_CORES)) return cpuString
def filter(self, lock): cpuTable = lock.get_cpus() cpus = cpuTable.keys() for cpu in cpus: time = cpuTable[cpu].time(1) percent = (time * 100.0) / lock.get_exclusive_stats().time(1) if percent > self.percent: return False return True
def get_percent(): return '%.2f' % ( (lock.get_exclusive_stats().time(DEFAULT_NUM_CORES) * 100.0) / SUMMARY.get_max_work(DEFAULT_NUM_CORES))
def get_length(): return str(lock.get_exclusive_stats().time(DEFAULT_NUM_CORES))