Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
IndikaKuma committed Jul 31, 2020
2 parents bb56369 + 0a7b674 commit e6edafa
Showing 1 changed file with 161 additions and 2 deletions.
163 changes: 161 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ sudo docker image ls
## REST API
# To send custom deployment events
```
POST http://{ip}:8080/rule-based-refactorer/v0.1/events/inputs
POST http://{ip}:8080/rule-based-refactorer/v0.1/api/events
```
Sample Requests

Expand All @@ -75,7 +75,7 @@ Sample Requests
```
# To send Prometheus alerts
```
POST http://{ip}:8080/rule-based-refactorer/v0.1/events/alerts
POST http://{ip}:8080/rule-based-refactorer/v0.1/api/alerts
```
Sample Requests

Expand Down Expand Up @@ -119,3 +119,162 @@ Sample Requests
}
```
# To send enable/disable pull-based monitoring. By default, the monitoring is disabled
```
POST http://{ip}:8080/rule-based-refactorer/v0.1/api/monitoring/pull?state=enabled
```

# To update or replace the refactoring rules

Send the rules (.drl) file as multipart/form-data (name:” file”, value: actual file)
```
PUT http://localhost:8080/rule-based-refactorer/v0.1/api/rules
```
# To update or replace the information about blueprint variants and input file

```
POST http://localhost:8080/rule-based-refactorer/v0.1/api/variants
```
A sample request

```
{
"input": "... content of the input.yaml...",
"blueprints": [
{
"target": [
"de",
"at"
],
"bptoken": "3d6dc7a8-6cfa-4675-ab12-e6b0d0a4c9e0"
},
{
"target": [
"it"
],
"bptoken": "3d6dc7a8-6cfa-4675-ab12-e6b0d0a4c9e0"
}
]
}
```
# Performance Predictor API

## To create the train-data table

```
POST http://ip:5000/per-predictor/dtr/features
```
A sample request

```
{
"features": [
"workload",
"D1",
"D3",
"D4",
"D5",
"D6",
"D7",
"D8",
"D9",
"D10",
"D12",
"D14",
"D15",
"D16"
],
"metrics": [
"mean_rt"
]
}
```
## To update the train-data

```
PUT http://ip:5000/per-predictor/dtr/features
```
A sample request

```
[
{
"workload": 100,
"D1": 1,
"D3": 0,
"D4": 0,
"D5": 0,
"D6": 0,
"D7": 1,
"D8": 0,
"D9": 0,
"D10": 0,
"D12": 0,
"D14": 1,
"D15": 0,
"D16": 0,
"mean_rt": 511
},
{
"workload": 2000,
"D1": 1,
"D3": 0,
"D4": 0,
"D5": 0,
"D6": 0,
"D7": 1,
"D8": 0,
"D9": 0,
"D10": 0,
"D12": 0,
"D14": 1,
"D15": 0,
"D16": 0,
"mean_rt": 5661
},
.....
]
```
## To train the predictor

```
http://34.66.81.209:5000/per-predictor/<model_type>/train
```
model_type can be dtr, rtfr, or mlpnn

dtr - decision tree regression
rtfr - Random Forest Regression
mlpnn - multiple-layer perceptron neural network

## To predict the performance using a trained predictor

```
POST http://ip:5000/per-predictor/<model_type>/predict
```
A sample request

```
[
{
"workload": 2000,
"D1": 1,
"D3": 1,
"D4": 0,
"D5": 1,
"D6": 0,
"D7": 0,
"D8": 0,
"D9": 1,
"D10": 1,
"D12": 0,
"D14": 1,
"D15": 0,
"D16": 0
}
]
```
## To delete the trainin dataset

```
DELETE http://ip:5000/per-predictor/<model_type>/features
```

0 comments on commit e6edafa

Please sign in to comment.