-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathplt_tpcc_recovery.py
36 lines (33 loc) · 1.27 KB
/
plt_tpcc_recovery.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
import matplotlib as mpl
mpl.use('Agg')
from pylab import *
import os
def collectRecoveryTimes(groupId):
resultDir = os.path.join(os.getcwd(), "results", groupId)
runs = os.listdir(resultDir)
builds = os.listdir(os.path.join(resultDir, runs[0]))
results = {}
for build in builds:
results[build] = {"recoveryTimes": [], "runTimes": []}
for run in runs:
for build in builds:
resultFile = os.path.join(resultDir, run, build, "recoverytime.txt")
recoveryTime = int(float(open(resultFile).read()))
results[build]["recoveryTimes"].append(recoveryTime / 1000.0)
results[build]["runTimes"].append(int(run.replace("deltaFilltime","")))
return results
if __name__ == "__main__":
groupId = "tpcc_recovery"
results = collectRecoveryTimes(groupId)
fig = plt.figure()
plt.title("TPC-C Recovery")
plt.ylabel("Recovery Time in ms")
plt.xlabel("Delta Filltime in s")
for build in results:
plotX = []
plotY = []
plotX, plotY = (list(t) for t in zip(*sorted(zip(results[build]["runTimes"], results[build]["recoveryTimes"]))))
plt.plot(plotX, plotY, label=build)
plt.legend(loc='lower right', prop={'size':10})
plt.savefig("recovery.pdf")
plt.close()