Skip to content

Commit f11d27d

Browse files
committed
Merge branch 'dev' of github.com:micado-scale/component-optimizer into dev
2 parents cdd44b4 + 92625b9 commit f11d27d

34 files changed

+175
-2127
lines changed

README.md

Lines changed: 34 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# MiCADO - Scaling Optimizer with Machine Learning Support
22

33
## Don't forget to set environment
4-
From project rott run
4+
From project root run
55
```source activate optimizer```
66

77
## Test program
@@ -12,59 +12,55 @@ From project root run
1212
From project root run
1313
```python helloMTA.py```
1414

15-
## Start program
16-
From project root run
15+
## Start program
16+
From project root run
1717
```python optimizer.py --cfg path/to_config_file```
1818

19-
```python optimizer.py --cfg config/config.yaml```
19+
```python optimizer.py --cfg config/config.yaml```
2020

21-
```python optimizer.py --cfg config/config.yaml --host=192.168.0.60```
21+
```python optimizer.py --cfg config/config.yaml --host=192.168.0.60```
2222

2323
```python optimizer.py --cfg config/config.yaml --host 0.0.0.0 --port 5000```
2424

2525

26-
## Test REST API
27-
__GET /optimizer/hello__
28-
Test REST API.
29-
```curl -X GET http://193.224.59.115:5000/optimizer/hello```
26+
## Test REST API
27+
__GET /optimizer/hello__
28+
Test REST API.
29+
```curl -X GET http://193.224.59.115:5000/optimizer/hello```
30+
31+
```curl -X GET http://193.224.59.115:5000/```
3032

31-
```curl -X GET http://193.224.59.115:5000/```
32-
33-
__POST /optimizer/init__
34-
Initialize optimizer with the neccessary constants.
35-
```curl -X POST http://127.0.0.1:5000/optimizer/init --data-binary @test_files/optimizer_constants.yaml```
33+
__POST /optimizer/init__
34+
Initialize optimizer with the neccessary constants.
35+
```curl -X POST http://127.0.0.1:5000/optimizer/init --data-binary @test_files/optimizer_constants.yaml```
3636

3737
```curl -X POST http://193.224.59.115:5000/optimizer/init --data-binary @test_files/optimizer_constants.yaml```
38-
39-
__POST /optimizer/sample__
40-
Send a new training sample.
41-
```curl -X POST http://127.0.0.1:5000/optimizer/sample --data-binary @test_files/metrics_sample_example.yaml```
4238

43-
```curl -X POST http://193.224.59.115:5000/optimizer/sample --data-binary @test_files/metrics_sample_example.yaml```
39+
__POST /optimizer/sample__
40+
Send a new training sample.
41+
```curl -X POST http://127.0.0.1:5000/optimizer/sample --data-binary @test_files/metrics_sample_example.yaml```
42+
43+
```curl -X POST http://193.224.59.115:5000/optimizer/sample --data-binary @test_files/metrics_sample_example.yaml```
44+
45+
```curl -X POST http://193.224.59.115:5000/optimizer/sample --data-binary @test_files/metrics_sample_example_up.yaml```
4446

45-
```curl -X POST http://193.224.59.115:5000/optimizer/sample --data-binary @test_files/metrics_sample_example_up.yaml```
47+
```curl -X POST http://193.224.59.115:5000/optimizer/sample --data-binary @test_files/metrics_sample_example_down.yaml```
4648

47-
```curl -X POST http://193.224.59.115:5000/optimizer/sample --data-binary @test_files/metrics_sample_example_down.yaml```
49+
__GET /optimizer/advice__
50+
Get scaling advice.
51+
```curl -X GET http://127.0.0.1:5000/optimizer/advice```
4852

49-
__POST /optimizer/backtest__
50-
Test the performacne of the system on historical data.
51-
```curl -X POST http://193.224.59.115:5000/optimizer/backtest --data-binary @test_files/metrics_sample_example.yaml```
52-
53-
__GET /optimizer/advice__
54-
Get scaling advice.
55-
```curl -X GET http://127.0.0.1:5000/optimizer/advice```
53+
```curl -X GET http://193.224.59.115:5000/optimizer/advice```
5654

57-
```curl -X GET http://193.224.59.115:5000/optimizer/advice```
55+
```curl -X GET http://193.224.59.115:5000/optimizer/advice?last=False```
5856

59-
```curl -X GET http://193.224.59.115:5000/optimizer/advice?last=False```
60-
61-
__GET /optimizer/training_data__
62-
Download zipped training data that contains both neural network and linear regression data.
63-
```curl -X GET http://127.0.0.1:5000/optimizer/training_data```
57+
__GET /optimizer/training_data__
58+
Download zipped training data that contains both neural network and linear regression data.
59+
```curl -X GET http://127.0.0.1:5000/optimizer/training_data```
6460

65-
## TEST CSV
66-
cd csv/csv_to_optimizer
67-
source env/csv_to_optimizer/bin/activate
68-
```python csv_to_optimizer.py```
61+
## TEST CSV
62+
cd csv/csv_to_optimizer
63+
source env/csv_to_optimizer/bin/activate
64+
```python csv_to_optimizer.py```
6965

7066

csv_to_optimizer.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import time
55

66
''' PLEASE, UPDATE THE VARIABLES BELOW! '''
7-
inputcsvfilepath = 'grafana_data_export_long_running_test-short.csv' #input
7+
inputcsvfilepath = 'data/grafana_data_export_long_running_test.csv' #input
88
outputcsvfilepath = 'result_for_grafana_data_export_long_running_test.csv' # ebbe tolja bele az output
99
separator=';' #updated automatically if file starts with sep= string
1010
max_number_of_rows_to_process = 20000 # parameter ennyit dolgozhat fel
@@ -69,7 +69,7 @@ def generate_sample(values=dict()):
6969
if values[index] != "null" else None
7070
continue
7171
if index == column_index_of_nodecount:
72-
sample['sample']['vm_number'] = int(values[index]) \
72+
sample['vm_number'] = int(values[index]) \
7373
if values[index] != "null" else None
7474
continue
7575
values[index] = None if values[index]=="null" else float(values[index])
@@ -86,7 +86,7 @@ def generate_sample(values=dict()):
8686
for s in sample['sample']['target_metrics']:
8787
if s['value'] is None:
8888
return None
89-
if sample['sample']['vm_number'] is None:
89+
if sample['vm_number'] is None:
9090
return None
9191
return sample
9292

file.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

file2.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

file3.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

file4.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

file5.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.
-75.8 KB
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)