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

Commit

Permalink
Minor changes in readme and error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
ricardolstephen committed Sep 10, 2020
1 parent aeee5a1 commit dbce9ab
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ While the metrics api associated with performance analyzer provides the last 5 s
In order to access the batch metrics api, first enable it using one of the following HTTP request:

```
POST localhost:9200/_opendistro/performanceanalyzer/batch/config -H ‘Content-Type: application/json’ -d ‘{enabled: true}’
POST localhost:9200/_opendistro/performanceanalyzer/batch/cluster/config -H ‘Content-Type: application/json’ -d ‘{enabled: true}’
POST localhost:9200/_opendistro/performanceanalyzer/batch/config -H ‘Content-Type: application/json’ -d ‘{"enabled": true}’
POST localhost:9200/_opendistro/performanceanalyzer/batch/cluster/config -H ‘Content-Type: application/json’ -d ‘{"enabled": true}’
```

The former enables batch metrics on a single node, while the latter enables it on nodes across the entire cluster. Batch metrics can be disabled using analogous queries with `{enabled: false}`.
The former enables batch metrics on a single node, while the latter enables it on nodes across the entire cluster. Batch metrics can be disabled using analogous queries with `{"enabled": false}`.

You can then query either the config or cluster config apis to see how many minutes worth of batch metrics data will be retained by nodes in the cluster (`batchMetricsRetentionPeriodMinutes`):

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,11 +216,12 @@ private void initBatchMetricsStateFromConf() {
boolean batchMetricsEnabledFromConf;
try {
batchMetricsEnabledFromConf = readBooleanFromFile(filePath);
} catch (NoSuchFileException e) {
LOG.debug("Error reading Performance Analyzer state from Conf file", e);
saveStateToConf(batchMetricsEnabledDefaultValue, BATCH_METRICS_ENABLED_CONF);
batchMetricsEnabledFromConf = batchMetricsEnabledDefaultValue;
} catch (Exception e) {
LOG.debug("Error reading Performance Analyzer state from Conf file", e);
if (e instanceof NoSuchFileException) {
saveStateToConf(batchMetricsEnabledDefaultValue, BATCH_METRICS_ENABLED_CONF);
}
batchMetricsEnabledFromConf = batchMetricsEnabledDefaultValue;
}

Expand Down

0 comments on commit dbce9ab

Please sign in to comment.