Skip to content

Commit

Permalink
refactor a constant and change the logging level for resource summary
Browse files Browse the repository at this point in the history
Signed-off-by: Kaushal Kumar <[email protected]>
  • Loading branch information
kaushalmahi12 committed Dec 21, 2023
1 parent e9b9585 commit 3169f74
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ public static void disablePA() throws InterruptedException {
public static class ClusterSettings {

Check warning on line 65 in src/main/java/org/opensearch/performanceanalyzer/LocalhostConnectionUtil.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/org/opensearch/performanceanalyzer/LocalhostConnectionUtil.java#L65

Added line #L65 was not covered by tests
static List<String> clusterSettings = new ArrayList<>();

public final static String SETTING_NOT_FOUND = "NULL";

static final String CLUSTER_SETTINGS_URL =
"/_cluster/settings?flat_settings=true&include_defaults=true&pretty";

Expand Down Expand Up @@ -111,7 +113,7 @@ public static String getClusterSettingValue(String settingName, String settingVa
}
return null;

Check warning on line 114 in src/main/java/org/opensearch/performanceanalyzer/LocalhostConnectionUtil.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/org/opensearch/performanceanalyzer/LocalhostConnectionUtil.java#L114

Added line #L114 was not covered by tests
})
.orElseGet(() -> "NULL");
.orElseGet(() -> SETTING_NOT_FOUND);
return settingVal;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public SearchBackPressurePolicy(SearchBackPressureClusterRCA searchBackPressureC
* @param issue an issue with the application
*/
private void record(HotResourceSummary summary) {
LOG.debug("SearchBackPressurePolicy capturing resource summary: {}", summary);
LOG.trace("SearchBackPressurePolicy capturing resource summary: {}", summary);

Check warning on line 106 in src/main/java/org/opensearch/performanceanalyzer/decisionmaker/deciders/searchbackpressure/SearchBackPressurePolicy.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/org/opensearch/performanceanalyzer/decisionmaker/deciders/searchbackpressure/SearchBackPressurePolicy.java#L106

Added line #L106 was not covered by tests

if (HEAP_SEARCHBP_SHARD_SIGNALS.contains(summary.getResource())) {
LOG.debug("Shard signal in SBP RCA summary...");

Check warning on line 109 in src/main/java/org/opensearch/performanceanalyzer/decisionmaker/deciders/searchbackpressure/SearchBackPressurePolicy.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/org/opensearch/performanceanalyzer/decisionmaker/deciders/searchbackpressure/SearchBackPressurePolicy.java#L109

Added line #L109 was not covered by tests
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

package org.opensearch.performanceanalyzer.rca.store.rca.searchbackpressure;

import static org.opensearch.performanceanalyzer.LocalhostConnectionUtil.ClusterSettings.SETTING_NOT_FOUND;
import static org.opensearch.performanceanalyzer.rca.framework.api.persist.SQLParsingUtil.readDataFromSqlResult;
import static org.opensearch.performanceanalyzer.rca.framework.api.summaries.ResourceUtil.SEARCHBACKPRESSURE_SHARD;
import static org.opensearch.performanceanalyzer.rca.framework.api.summaries.ResourceUtil.SEARCHBACKPRESSURE_TASK;
Expand Down Expand Up @@ -199,7 +200,6 @@ private long getUpdatedHeapUsedIncreaseThreshold() {
LocalhostConnectionUtil.ClusterSettings.getClusterSettingValue(
SEARCH_BACKPRESSURE_HEAP_DURESS_KEY,
SEARCH_BACKPRESSURE_HEAP_DURESS_VAL_REGEX);
final String SETTING_NOT_FOUND = "NULL";
// If there was an error fetching the threshold ignore for this run
if (val.equals(SETTING_NOT_FOUND)) {
LOG.warn("There was an error fetching the node duress heap settings value...");
Expand Down

0 comments on commit 3169f74

Please sign in to comment.