Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Commit

Permalink
Changes to the ReadMe File and deserializing the summary in the Json …
Browse files Browse the repository at this point in the history
…format. (#494)

Co-authored-by: Aditya Jindal <[email protected]>
  • Loading branch information
adityaj1107 and Aditya Jindal authored Oct 26, 2020
1 parent 7d271a9 commit b34f487
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 39 deletions.
36 changes: 35 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ The sample RCA response from above api
```

### Temperature profiles
------------------------
There are ways to get the temperature profile of a cluster and of individual nodes.

The cluster level RCA can only be queried from the elected master using the following rest API.
Expand All @@ -124,6 +123,41 @@ In order to get the temperature of a particular node, we can use:

`curl "localhost:9600/_opendistro/_performanceanalyzer/rca?name=AllTemperatureDimensions&local=true"`

## Rest API to get the ACTIONS suggested by the decider

This api returns the last suggested action set by the decider framework.

```
curl --url "localhost:9650/_opendistro/_performanceanalyzer/actions" -XGET
```

The sample response from the above API:

```
{
"LastSuggestedActionSet": [
{
"actionName": "ModifyQueueCapacity",
"actionable": true,
"coolOffPeriod": 300000,
"muted": false,
"nodeIds": "{oSN5LEstThe25y8NrCGyAg}",
"nodeIps": "{10.212.52.87}",
"summary": {
"Id": "oSN5LEstThe25y8NrCGyAg",
"Ip": "10.212.52.87",
"canUpdate": true,
"coolOffPeriodInMillis": 300000,
"currentCapacity": 0,
"desiredCapacity": 1000,
"resource": 5
}
"timestamp": 1603671580290
}
]
}
```

## Building, Deploying, and Running the RCA Framework
Please refer to the [Install Guide](./INSTALL.md) for detailed information on building, installing and running the RCA framework.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

Expand Down Expand Up @@ -114,7 +115,7 @@ public JsonElement toJson() {
summaryObj.addProperty(SQL_SCHEMA_CONSTANTS.ACTION_COL_NAME, this.actionName);
summaryObj.addProperty(SQL_SCHEMA_CONSTANTS.TIMESTAMP_COL_NAME, this.timestamp);
summaryObj.addProperty(SQL_SCHEMA_CONSTANTS.NODE_IDS_NAME, this.nodeIds);
summaryObj.addProperty(SQL_SCHEMA_CONSTANTS.SUMMARY_NAME, this.summary);
summaryObj.add(SQL_SCHEMA_CONSTANTS.SUMMARY_NAME, new JsonParser().parse(this.summary));
summaryObj.addProperty(SQL_SCHEMA_CONSTANTS.ACTIONABLE_NAME, this.actionable);
summaryObj.addProperty(SQL_SCHEMA_CONSTANTS.COOLOFFPERIOD_NAME, this.coolOffPeriod);
return summaryObj;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,44 +46,22 @@
* {
* "LastSuggestedActionSet": [
* {
* "actionName": "MockAction1",
* "actionable": false,
* "coolOffPeriod": 10,
* "actionName": "ModifyQueueCapacity",
* "actionable": true,
* "coolOffPeriod": 300000,
* "muted": false,
* "nodeIds": "1,11",
* "nodeIps": "1.1.1.1,11.11.11.11",
* "summary": "MockSummary",
* "timestamp": 1602538860025
* },
* {
* "actionName": "MockAction2",
* "actionable": false,
* "coolOffPeriod": 20,
* "muted": false,
* "nodeIds": "2,22",
* "nodeIps": "2.2.2.2,22.22.22.22",
* "summary": "MockSummary",
* "timestamp": 1602538860025
* },
* {
* "actionName": "MockAction1",
* "actionable": false,
* "coolOffPeriod": 30,
* "muted": false,
* "nodeIds": "1,11",
* "nodeIps": "1.1.1.1,11.11.11.11",
* "summary": "MockSummary",
* "timestamp": 1602538860025
* },
* {
* "actionName": "MockAction2",
* "actionable": false,
* "coolOffPeriod": 40,
* "muted": false,
* "nodeIds": "2,22",
* "nodeIps": "2.2.2.2,22.22.22.22",
* "summary": "MockSummary",
* "timestamp": 1602538860025
* "nodeIds": "{oSN5LEstThe25y8NrCGyAg}",
* "nodeIps": "{10.212.52.87}",
* "summary": {
* "Id": "oSN5LEstThe25y8NrCGyAg",
* "Ip": "10.212.52.87",
* "canUpdate": true,
* "coolOffPeriodInMillis": 300000,
* "currentCapacity": 0,
* "desiredCapacity": 1000,
* "resource": 5
* }
* "timestamp": 1603671580290
* }
* ]
* }
Expand Down

0 comments on commit b34f487

Please sign in to comment.