-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgrafanaplot.m~
131 lines (112 loc) · 5.41 KB
/
grafanaplot.m~
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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
format longG
clear all;close all;
stringCSV = 'Pod Count-data-2021-06-05 00_51_55';
bytesDevider = 1000000;
bytesDevider = 1;
dataID = '8';
namespace = 'ingress';
data = readtable(strcat(strcat(strcat('/Users/mymac/Documents/SCRIPTSHEET/SKRIPSI/data_grafana/',dataID),'/'),strcat(strcat(strcat(namespace,'/'),stringCSV),'.csv')), 'ReadVariableNames', false, 'HeaderLines', 2);
% ini untuk format date seperti halnya di jmeter ya
% x = seconds((datenum(datestr(data.ElapsedTime, 'yyyy-mm-dd hh:MM:ss.fff')) - datenum(datestr(data{1,1}, 'yyyy-mm-dd hh:MM:ss.fff'))) * 100000);
% x.Format = 'hh:mm:ss';
markers = {'+','*','.','o','x','v','d','^','s','>','<','v','p','h','p','v','<','>','s','^','d','v','x','o','.','*'};
% markers = {'.','^'};
colors = {'r','b','m','k',[0 0.7 0],'c','y','r','b','m','k',[0 0.7 0]};
lines = {'-','-.','--',':',':','--'};
line_width = 0.9;
marker_size = 2.8;
%marker_size = 5;
marker_counter = 1;
color_counter = 1;
line_counter = 1;
ylabelspod='Number of pods';
ylabelscpusum='Number of core CPU';
ylabelslat = 'Response latencies (ms)';
ylabels1='Number of threads';
ynodes='Number of nodes';
ylabelsmem='Mega Bytes (MB)';
ylabelstruput='Mega Bytes (MB) per second';
ylabels3='TCP connections';
yredis='Command executed per second';
ythread='Number of active threads';
legend_base_name = 'ingress-pods-';
%legend_base_name = 'Worker-';
% legend_base_name = 'redis-node-';
% legend_base_name = 'iotmyth-cpu-';
%legend_base_name = 'iotmyth-memory-';
% kalo ini format number dalam menit elapsed time
x = (datenum(datestr(data{:,1}, 'yyyy-mm-dd hh:MM:ss.fff')) - datenum(datestr(data{1,1}, 'yyyy-mm-dd hh:MM:ss.fff'))) * 100000/60;
% ini untuk data x yang pure number aja, bukan elapsed time
%x = data{:,1};
hold on
if(size(data,2) == 2)
markers = {'.'};
colors = {'r'};
ylabel(ylabelspod,'FontSize',15);
end
for i=1:size(data,2)-1
plot(x,data{:,i+1}/bytesDevider,strcat(lines{line_counter},strcat('',markers{marker_counter})),'Color',colors{color_counter},'MarkerSize',marker_size,'LineWidth',line_width,'DisplayName',strcat(legend_base_name,sprintf('%.0f',i)));
if mod(i, size(markers,2)) == 0
marker_counter = 1;
else
marker_counter=marker_counter+1;
end
if mod(i, size(colors,2)) == 0
color_counter = 1;
else
color_counter=color_counter+1;
end
if mod(i,size(lines,2)) == 0
line_counter = 1;
else
line_counter=line_counter+1;
end
end
box on;
grid on;
ax = gca;
ax.YAxis.Exponent = 0;
% ax.YAxis.TickLabelFormat = '%.0f';
ax.GridLineStyle = ':';
ax.GridAlpha = 0.3;
ax.LineWidth = 0.9;
set(gca,'FontSize',16);
% legend('long unregistered','not started','ready','unready','unregistered');
legend('show');
lgd = legend;
% lgd.FontSize=10;
% lgd.Location = 'northwest';
% lgd.Location = 'north';
set(gcf,'Units','Inches');
% title({'Pod Count: ingress (HTTP 1M Threads)','Instance Type (m5.2xlarge/m5a.2xlarge)'},'FontSize',14);
% title({'CPU SUM: ingress (HTTP 1M Threads)','Instance Type (m5.2xlarge/m5a.2xlarge)'},'FontSize',14);
% title({'CPU: ingress (HTTP 1M Threads)','Instance Type (m5.2xlarge/m5a.2xlarge)'},'FontSize',14);
% title({'Memory: ingress (HTTP 1M Threads)','Instance Type (m5.2xlarge/m5a.2xlarge)'},'FontSize',14);
% title({'Node Command: redis cluster (HTTP 1M Threads)','Instance Type (m5.2xlarge/m5a.2xlarge)'},'FontSize',14);
% title({'Node scaling (HTTP 1M Threads)','Instance Type (m5.2xlarge/m5a.2xlarge)'},'FontSize',14);
% title({'Network RX: ingress (HTTP 1M Threads)','Instance Type (m5.2xlarge/m5a.2xlarge)'},'FontSize',14);
% title({'Network TX: ingress (HTTP 1M Threads)','Instance Type (m5.2xlarge/m5a.2xlarge)'},'FontSize',14);
%title({'Network Load Balancer (HTTP 1M Threads)','Instance Type (m5.2xlarge/m5a.2xlarge)'},'FontSize',14);
title({'Pod Count: ingress (MQTT 1M Threads)','Instance Type (m5.2xlarge/m5a.2xlarge)'},'FontSize',14);
% title({'CPU SUM: ingress (MQTT 1M Threads)','Instance Type (m5.2xlarge/m5a.2xlarge)'},'FontSize',14);
% title({'CPU: redis (MQTT 1M Threads)','Instance Type (m5.2xlarge/m5a.2xlarge)'},'FontSize',14);
% title({'Memory: ingress (MQTT 1M Threads)','Instance Type (m5.2xlarge/m5a.2xlarge)'},'FontSize',14);
% title({'Node Memory: redis cluster (MQTT 1M Threads)','Instance Type (m5.2xlarge/m5a.2xlarge)'},'FontSize',14);
% title({'Node Command: redis cluster (MQTT 1M Threads)','Instance Type (m5.2xlarge/m5a.2xlarge)'},'FontSize',14);
% title({'Node scaling (MQTT 1M Threads)','Instance Type (m5.2xlarge/m5a.2xlarge)'},'FontSize',14);
% title({'Network RX: ingress (MQTT 1M Threads)','Instance Type (m5.2xlarge/m5a.2xlarge)'},'FontSize',14);
% title({'Network TX: ingress (MQTT 1M Threads)','Instance Type (m5.2xlarge/m5a.2xlarge)'},'FontSize',14);
%title({'Network Load Balancer (MQTT 1M Threads)','Instance Type (m5.2xlarge/m5a.2xlarge)'},'FontSize',14);
xlabel('Elapsed time (minutes)','FontSize',15);
ylabel(ylabelspod,'FontSize',15);
pos = get(gcf,'Position');
ymax = max(data{:,2});
ylim([0,ymax(1)*1.2])
% ylim([0,15])
%xlim([min(x),max(x)])
set(findall(gcf,'-property','FontName'),'FontName','Times New Roman');
set(gcf,'PaperPositionMode','Auto','PaperUnits','Inches','PaperSize',[pos(3), pos(4)]);
print(gcf,'-dpdf',strcat('/Users/mymac/Documents/SCRIPTSHEET/SKRIPSI/hasilgrafik/',strcat(dataID,stringCSV)),'-r0');
savefig(strcat('/Users/mymac/Documents/SCRIPTSHEET/SKRIPSI/hasilgrafik/',strcat(dataID,stringCSV)));
% print -dpdf -painters hasilgrafik/1a
hold off;