def __init__(self, task_types: list): # ***** set some parameters of generating workloads ***** # trace time period: 0 -> 0-6h ; 1 -> 6-24h self.tracetimeid = 0 # job_number: 14 -> 0-6h; 9 -> 6-24h self.job_number = 0 # jobconsist_tasknumber: 6 -> 0-6h; 9 ->6-24h (set: cloud nodes number + edge nodes number) self.jobconsist_tasknumber = 4 # default:0(6,9), cloud node:1(10,15), edge node:2(8,12), cloud and edge node:3(12,18) self.nodenumberid = 0 # cpu and memory type: 1 -> low cpu, low memory; 2 -> low cpu, high memory; 3 -> high cpu, low memory; 4 -> high cpu, high memory self.workloadtypeid = 1 # alibabatrace: job_tasknum self.job_tasknum = 1 self.trace_data = read_sql_file(self.tracetimeid, self.workloadtypeid, self.jobconsist_tasknumber, self.job_tasknum, self.job_number) print('job cnt:', len(self.trace_data)) print('job tasks:', [len(job['job.tasks']) for job in self.trace_data]) print("-----------------------------") self.job_count = 0 self.task_count = 0 self.task_types = task_types self.prev_job_last_start_time = 0
def __init__(self, task_types: list): # set some parameters self.job_number = 14 self.tracetimeid = 1 self.workloadtypeid = 4 self.jobconsist_tasknumber = 4 self.job_tasknum = 10000 self.trace_data = read_sql_file(self.tracetimeid, self.workloadtypeid, self.jobconsist_tasknumber, self.job_tasknum) self.job_count = 0 self.task_count = 0 self.task_types = task_types self.prev_job_last_start_time = 0