Skip to content

Commit 9181059

Browse files
committed
update code for Figure 6(c)
1 parent 878501f commit 9181059

3 files changed

Lines changed: 41 additions & 56 deletions

File tree

Lines changed: 16 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,70 +1,33 @@
1-
% clc
2-
% clear
3-
load GsightLatencyData;
1+
clc
2+
clear
3+
load GsightLatencyDataNew;
44
figure1 = figure('PaperSize',[20.98404194812 29.67743169791]);
55

66
axes1 = axes('Parent',figure1,'YGrid','on');
77
box(axes1,'on');
88
hold(axes1,'all');
9-
GsightLatencyData=GsightLatencyData;
10-
GsightLatencyData(:,[5 3 2])=GsightLatencyData(:,[5 3 2])*0.8;
11-
a1 = GsightLatencyData(:,5);%EFRA390 252
12-
b1 = GsightLatencyData(:,1);%ElaX469 343
13-
c1 = GsightLatencyData(:,2);%EFRA390 425
14-
d1 = GsightLatencyData(:,4)-200;%peak401 550
15-
e1 = GsightLatencyData(:,6)-200;%PRESS681 642
16-
17-
hold on
18-
lw = 3
19-
xi = linspace(min(a1),max(a1),100);
20-
F = ksdensity(a1,xi,'function','cdf');
21-
plot(xi,F,'--', 'LineWidth',lw ,'color',[35 31 32]/255); %红色
22-
23-
xi = linspace(min(b1),max(b1),100);
24-
F = ksdensity(b1,xi,'function','cdf');
25-
plot(xi,F,':', 'LineWidth',lw ,'color',[35 31 32]/255); %紫色
9+
lw=3;
10+
plot(GsightLatencyDataNew(:,2),GsightLatencyDataNew(:,1),'--', 'LineWidth',lw ,'color',[35 31 32]/255); %红色
11+
plot(GsightLatencyDataNew(:,4),GsightLatencyDataNew(:,3),':', 'LineWidth',lw ,'color',[35 31 32]/255); %紫色
12+
plot(GsightLatencyDataNew(:,6),GsightLatencyDataNew(:,5),'-', 'LineWidth',lw ,'color', [238 41 47]/255); %绿色
13+
plot(GsightLatencyDataNew(:,8),GsightLatencyDataNew(:,7),'-', 'LineWidth',lw ,'color', [35 31 32]/255) %黄色
14+
plot(GsightLatencyDataNew(:,10),GsightLatencyDataNew(:,9),'-.', 'LineWidth',lw ,'color', [35 31 32]/255) %黄色
2615

27-
xi = linspace(min(c1),max(c1),100);
28-
F = ksdensity(c1,xi,'function','cdf');
29-
plot(xi,F,'-', 'LineWidth',lw ,'color', [238 41 47]/255); %绿色
30-
31-
xi = linspace(min(d1),max(d1),100);
32-
F = ksdensity(d1,xi,'function','cdf');
33-
plot(xi,F,'-', 'LineWidth',lw ,'color', [35 31 32]/255) %黄色
34-
35-
xi = linspace(min(e1),max(e1),100);
36-
F = ksdensity(e1,xi,'function','cdf');
37-
plot(xi,F,'-.', 'LineWidth',lw ,'color', [35 31 32]/255) %黄色
38-
% aa1 = plot(a1,x,'-', 'LineWidth',lw ,'color',[255 215 0]/255); %红色
39-
% bb1 = plot(b1,x,'-', 'LineWidth',lw ,'color', [153 102 153]/255); %紫色
40-
% cc1 = plot(c1,x,'-', 'LineWidth',lw ,'color', [51 153 51]/255); %绿色
41-
% dd1 = plot(e1,x,'-.', 'LineWidth',1.5,'color', [149 14 8]/255) %黄色
42-
% ee1 = plot([0 1400],[0.99 0.99],'-.', 'LineWidth',1.5,'color', [0 0 255]/255) %
43-
% hold on;
44-
% plot(967,0.9,'or', 'MarkerSize',12,'LineWidth',2.5) %黄色
45-
% hold on;
46-
% plot(542,0.9,'or', 'MarkerSize',12,'LineWidth',2.5) %黄色
4716
set(gca,'YLim',[0 1]);%X轴的数据显示范围
48-
set(gca,'YTick',[0 : .2: 1]);%设置要显示坐标刻度
49-
% %set(gca,'yticklabels',{'0' ,'24' ,'48', '72', '96', '120'});
17+
set(gca,'YTick',[0 : .2: 1]);%设置要显示坐标刻度
5018
set(gca,'XLim',[100 1300]);%X轴的数据显示范围
5119
set(gca,'XTick',[100 : 300: 1300]);%设置要显示坐标刻度
5220
set(gca,'xticklabels',[50 : 150: 1300]);%设置要显示坐标刻度
53-
set(gca, 'Fontsize' ,18)
54-
%set(gca,'XTicklabel',{0:2:10});%设置要显示坐标刻度
55-
56-
% title('EMU of redis with BE Tasks', 'FontSize' , 13)
21+
set(gca, 'Fontsize' ,18)
22+
5723
xlabel('Latency (ms)', 'Fontsize' ,18)
5824
ylabel('CDF', 'Fontsize' ,18)
5925
set(gca, 'GridLineStyle', ':','ticklength',[0.002 0])
6026
set(gca,'xcolor',[0 0 0]);
61-
set(gca,'ycolor',[0 0 0]);
62-
%set the position of figure and axis
63-
set(gcf,'position',[100 100 300 240])
64-
% set(gca,'units','normalized','position',[0.2 0.3 0.6 0.5],'box','off')
65-
set(gca,'units','normalized','position',[0.24 0.3 0.7 0.65],'box','off')
66-
%legend content
67-
legend({'KNN','LR','RFR','SVR','MLP','90th'},'FontSize',12)
27+
set(gca,'ycolor',[0 0 0]);
28+
set(gcf,'position',[100 100 300 240])
29+
set(gca,'units','normalized','position',[0.24 0.3 0.7 0.65],'box','off')
30+
legend('KNN','LR','RFR','SVR','MLP','90th')
6831
box on
6932
grid on
7033

7.22 KB
Binary file not shown.

README.md

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,40 @@
33
## Benchmark Installation
44
1. Deployment guide of OpenFaaS for Kubernetes is available here: https://docs.openfaas.com/deployment/kubernetes/.
55
2. Run benchmarks /install.sh to build & deploy all functions.
6+
67
Notice: this operation takes some time.
78
We can also build & deploy functions according to the description below: https://docs.openfaas.com/cli/build/.
89

910
## Workload Generator Installation
1011
Guidance is available here: https://github.com/tjulym/gray/blob/SC21ORO/loadGen/README.md.
12+
1113
Notice: Be sure that OpenFaaS functions and workload generator work well before running thefollowing script. The project LoadGenSimClient cannot work if the LoadGen has not yet been deployed.
1214

1315
## Metrics Collector
14-
Compile gray/gsightCollector/ to generate a runnable jar package. Then, run java -jar collector.jar func_name interval result_dir_name to collect metrics of corresponding functions under their solo-run. Run models/collector/start.sh , and it will create a csv file that stores the metrics under co-locating. You can edit start.sh to set the QPS of LS workloads, edit models/collector/get_ml_data.py to set the amount of data to be collected, and edit models/collector/runBEPara.py to configure tasks that co-locate with the LS of social network.
16+
Compile gray/gsightCollector/ to generate a runnable jar package. Then, run
17+
```bash
18+
java -jar collector.jar func_name interval result_dir_name
19+
```
20+
to collect metrics of corresponding functions under their solo-run. Run
21+
```bash
22+
./models/collector/start.sh
23+
```
24+
and it will create a csv file that stores the metrics under co-locating. You can edit start.sh to set the QPS of LS workloads, edit models/collector/get_ml_data.py to set the amount of data to be collected, and edit models/collector/runBEPara.py to configure tasks that co-locate with the LS of social network.
1525

1626
## Model Training
17-
The initial training dataset is in models/algorithm/data/. Run models/algorithm/RFR_model_training.py.py , and it will create a file named "RFR" to store the RM model, and csv file to store importance of the metrics.
18-
Run models/algorithm/plots_imports.py to review the impurity based importance of the 16 metrics, and run models/algorithm/plots_imports_all.py to show the importance of 16 metrics under all combinations of workload and server.
27+
The initial training dataset is in models/algorithm/data/. Run
28+
```python
29+
python models/algorithm/RFR_model_training.py
30+
```
31+
and it will create a file named "RFR" to store the RM model, and csv file to store importance of the metrics.
32+
Run
33+
```python
34+
python models/algorithm/plots_imports.py
35+
```
36+
to review the impurity based importance of the 16 metrics, and run
37+
```python
38+
python models/algorithm/plots_imports_all.py
39+
```
40+
to show the importance of 16 metrics under all combinations of workload and server.
1941

2042
## Scheduler

0 commit comments

Comments
 (0)