def __main__(): loglist = [] for job in (tuple(RepositoryUtils.GetJobs(True)) + tuple(RepositoryUtils.GetDeletedJobs())): stats = JobUtils.CalculateJobStatistics( job, RepositoryUtils.GetJobTasks(job, True)) loglist.append('\t'.join(( job.JobId, job.JobUserName, datetime( job.JobCompletedDateTime.Year, job.JobCompletedDateTime.Month, job.JobCompletedDateTime.Day, job.JobCompletedDateTime.Hour, job.JobCompletedDateTime.Minute, job.JobCompletedDateTime.Second, job.JobCompletedDateTime.Ticks % 10**7 // 10, ).isoformat(), str(stats.TotalTaskRenderTime.Ticks), )) + '\n') with open('log_api.csv', 'w') as output: output.writelines(loglist) return None
with open(fldr + 'suph_dl.csv') as input_suph: next(input_suph) for suph in input_suph: data = suph.replace(',', ' ').split() if 1 < len(data): suph_slave[data[0]] = float(data[1]) with open(fldr + 'ch_group.txt') as input_ch: ch_group = { group.strip().lower() for group in input_ch if group.strip()} all_group = set() all_slave = set() all_job = [] report_users = {} for job in (tuple(RepositoryUtils.GetJobs(True)) + tuple(RepositoryUtils.GetDeletedJobs())): all_group.add(job.JobGroup.lower()) task_job = RepositoryUtils.GetJobTasks(job, True) ticks = 0.0 for task in task_job: slave = task.TaskSlaveName.lower() all_slave.add(slave) if slave in suph_slave: suph = suph_slave[slave] else: suph = core if 0 < task.TaskRenderTime.Ticks < ticks_null: ticks += task.TaskRenderTime.Ticks * suph su = round(ticks // 360000 / 100000, 8) stats = JobUtils.CalculateJobStatistics(job, task_job)