-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathTimeperTask_MFLog.py
65 lines (29 loc) · 889 Bytes
/
TimeperTask_MFLog.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# This program parses a Makeflow log to find time per task
# Author: Olivia Choudhury
import os, fileinput
list=[]
Dict={}
#for line in fileinput.input(['20w_Makeflow.makeflowlog']):
for line in fileinput.input(['20w_MachineConfig_Makeflow.makeflowlog']):
list=line.split(' ')
Task_ID=list[1]
if(len(Task_ID)<3):
# Convert Timestamp in microsec to sec
Timestamp_micro=list[0]
Timestamp=Timestamp_micro[:len(Timestamp_micro)-6]
if Task_ID in Dict.keys():
val=Dict[Task_ID]+'_'+Timestamp
Dict[Task_ID]=val
else:
Dict[Task_ID]=Timestamp
list1=[]
for k,v in Dict.iteritems():
# print k+' -> '+v
if (int(k)>=50):
#print k
# Get start and complete time for a Task ID
list1=v.split('_')
time_start=list1[0]
time_end=list1[1]
#os.system("date -d @"+time_start+" +'%H:%M:%S'")
os.system("date -d @"+time_end+" +'%H:%M:%S'")