-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgenBars.py
103 lines (70 loc) · 2.94 KB
/
genBars.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Mon Dec 19 18:02:15 2016
@author: carlos
"""
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import pandas as pd
import random as rand
executionId= 'xxx'
file_path = "./"+executionId
calculateReliability = False
numberofGenerations=300
df = pd.read_csv(file_path+'/execution_data.csv',sep=';')
df2 = pd.read_csv(file_path+'/kubernetes_data.csv',sep=';')
for nodeNumber in [250,300,350,400]:
for metric in ['fitnodeNumber','fitthresholdDistance','fitclusterbalanced','fitnetworkDistance','fitreliability']:
figtitleStr = str(nodeNumber) + " physical machines"
if metric=='fitnodeNumber':
kmetric = 'usednodes'
if metric=='fitthresholdDistance':
kmetric = 'thr'
if metric=='fitclusterbalanced':
kmetric = 'clus'
if metric=='fitnetworkDistance':
kmetric = 'net'
if metric=='fitreliability':
kmetric = 'rel'
# if metric=='fitnodeNumber':
# tmetric = 'min4thrnodeNumber'
# if metric=='fitthresholdDistance':
# tmetric = 'min4thrthresholdDistance'
# if metric=='fitclusterbalanced':
# tmetric = 'min4thclusterbalanced'
# if metric=='fitnetworkDistance':
# tmetric = 'min4thrnetworkDistance'
# if metric=='fitreliability':
# tmetric = 'min4thrreliability'
fig = plt.figure()
fig.suptitle(figtitleStr, fontsize=18)
ax = fig.add_subplot(111)
ax.yaxis.set_ticks_position('both')
df['label'] = df['reqs'].map(str) + "reqs-" + df['apps'].map(str)+'apps'
df['Kubernetes']=df2[kmetric]
df['NSGA-II']=df[metric]
plt.gcf().subplots_adjust(bottom=0.38)
df[(df['nodes']==nodeNumber)][['NSGA-II','Kubernetes', 'label']].plot(ax=ax,kind='bar', x = 'label', rot=90, figsize=(8,4))
ax.set_xlabel('Experiment configurations',fontsize=18)
if metric=='fitnodeNumber':
ax.set_ylabel('Number of nodes',fontsize=18)
if metric=='fitthresholdDistance':
ax.set_ylabel('Threshold Distance',fontsize=18)
plt.ylim([0,2000])
if metric=='fitclusterbalanced':
ax.set_ylabel('Cluster Balanced',fontsize=18)
plt.ylim([0,0.38])
if metric=='fitnetworkDistance':
ax.set_ylabel('Network Distance',fontsize=18)
plt.ylim([0,60])
if metric=='fitreliability':
ax.set_ylabel('System Failure',fontsize=18)
plt.ylim([0,0.025])
#ax.set_title(figtitleStr, fontsize=18)
# plt.show()
plt.grid()
fig.savefig(file_path+'/'+metric+str(nodeNumber)+'.eps',format='eps')
plt.close(fig)
#df[(df['nodes']==100) & (df['apps']==1)][['fitnodeNumber']].plot(kind='bar', use_index=False, xticks = df['reqs'])