Scheduler
aging.py
Go to the documentation of this file.
1 #!/usr/bin/env python
2 import matplotlib.pyplot as plt
3 import sys
4 
5 filename = "scratch/configuration.confinstantaneousAgingReport.txt"
6 if (len(sys.argv) > 1):
7  filename = sys.argv[1]
8 
9 with open(filename) as f:
10  print f.readline()
11  time = []
12  inst = []
13  cumul = []
14  for line in f:
15 # if (len(inst) < 10000):
16  entry = line.split(":")
17  time.append(float(entry[0]))
18  inst.append(float(entry[1]))
19  if (len(cumul) == 0):
20  cumul.append(float(entry[1]))
21  else:
22  cumul.append(cumul[len(cumul)-1] + float(entry[1]))
23 
24 #f = open("reports/energyReport.txt")
25 #line = f.readline()
26 #time2 = []
27 #power = []
28 #for line in f:
29 # entry = line.split(":")
30 # time2.append(float(entry[0]))
31 # power.append(float(entry[1]))
32 #f.close()
33 
34 
35 #avg = []
36 #buf = []
37 #bufindex = 0
38 #for i in range(0,20001):
39 # buf.append(temp[i])
40 #for i in range (0,10000):
41 # avg.append(0.0)
42 #sum = 0
43 #for i in range(0,20001):
44 # sum += buf[i]
45 #avg.append(sum/20001)
46 #for i in range(10001, len(temp)-10000):
47 # sum -= buf[bufindex]
48 # buf[bufindex] = temp[i+10000]
49 # sum += buf[bufindex]
50 # avg.append(sum/20001)
51 # bufindex += 1
52 # if (bufindex == 20000):
53 # bufindex = 0
54 #for i in range (len(temp)-10001,len(temp)-1):
55 # avg.append(0)
56 
57 
58 
59 
60 
61 
62 #avg = []
63 #alpha = 0.0001
64 #avg.append(0.0)
65 #for i in range(1,len(temp)):
66 # a = temp[i]*alpha + (1-alpha)*avg[i-1]
67 # avg.append(a)
68 
69 
70 #plt.plot(time, inst, 'ro')
71 #plt.plot(time, cumul, 'bo')
72 
73 print cumul[len(cumul)-1]
74 
75 #plt.plot(time2, power, 'bo')
76 #plt.plot(time, avg, 'b-')
77 plt.show()