-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathplot.py
More file actions
executable file
·58 lines (44 loc) · 1.92 KB
/
plot.py
File metadata and controls
executable file
·58 lines (44 loc) · 1.92 KB
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
#!/usr/bin/python3
import matplotlib.pyplot as plt
import numpy
INPUT_DATA_CSV = 'benchmark.2017.05.12.11.46'
in_data = numpy.genfromtxt(
INPUT_DATA_CSV, delimiter=',', names=[
'playbooks', 'dockerreal', 'dockeruser', 'dockersys',
'nodockerreal', 'nodockeruser', 'nodockersys'])
def create_plot(x_data, line1_label, line2_label, filename):
x_minor_ticks = [int(x) for x in x_data[1:]]
x_major_ticks = [int(x) for x in x_data[1::5]]
plt.xticks(x_major_ticks)
plt.ylabel(line1_label)
plt.xlabel(line2_label)
plt.legend(framealpha=0.1)
plt.box(on=False)
plt.grid(which='minor', alpha=0.1)
plt.grid(which='major', alpha=0.2)
plt.minorticks_on()
plt.savefig(filename)
plt.close()
plt.plot(in_data['playbooks'], in_data['dockerreal'],
label='Real Time with Docker', linewidth=3.0)
plt.plot(in_data['playbooks'], in_data['nodockerreal'],
label='Real Time without Docker', linewidth=3.0)
create_plot(in_data['playbooks'],
'Real-Time in seconds',
'Number of checked playbooks', "real-time-comp.png")
####################################################################
plt.plot(in_data['playbooks'], in_data['dockeruser'],
label='User Time with Docker', linewidth=3.0)
plt.plot(in_data['playbooks'], in_data['nodockeruser'],
label='User Time without Docker', linewidth=3.0)
create_plot(in_data['playbooks'],
'User-Time in seconds',
'Number of checked playbooks', "user-time-comp.png")
####################################################################
plt.plot(in_data['playbooks'], in_data['dockersys'],
label='Sys Time with Docker', linewidth=3.0)
plt.plot(in_data['playbooks'], in_data['nodockersys'],
label='Sys Time without Docker', linewidth=3.0)
create_plot(in_data['playbooks'],
'Sys-Time in seconds',
'Number of checked playbooks', "sys-time-comp.png")