Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

package org.opensearch.performanceanalyzer.config;

import static org.opensearch.performanceanalyzer.core.Util.OPENSEARCH_HOME;

import com.google.common.annotations.VisibleForTesting;
import java.io.File;
Expand All @@ -23,15 +22,6 @@ public class PluginSettings {

private static PluginSettings instance;
public static final String CONFIG_FILES_PATH = "config/";
public static final String DEFAULT_CONFIG_FOLDER_PATH =
OPENSEARCH_HOME
+ File.separator
+ "config"
+ File.separator
+ "opensearch-performance-analyzer"
+ File.separator;
private static final String DEFAULT_CONFIG_FILE_PATH =
DEFAULT_CONFIG_FOLDER_PATH + "performance-analyzer.properties";
private static final String METRICS_LOCATION_KEY = "metrics-location";
private static final String METRICS_LOCATION_DEFAULT = "/dev/shm/performanceanalyzer/";
private static final String DELETION_INTERVAL_KEY = "metrics-deletion-interval";
Expand Down Expand Up @@ -65,8 +55,8 @@ public class PluginSettings {

private boolean httpsEnabled;
private Properties settings;
private final String configFolderPath;
private final String configFilePath;
private String configFolderPath;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Any reason why this isn't final any more?

private String configFilePath;

/**
* Determines how many minutes worth of metricsdb files will be retained if batch metrics is
Expand Down Expand Up @@ -176,8 +166,8 @@ private PluginSettings(String cfPath) {
rpcPort = RPC_DEFAULT_PORT;
webServicePort = WEBSERVICE_DEFAULT_PORT;
if (cfPath == null || cfPath.isEmpty()) {
this.configFolderPath = DEFAULT_CONFIG_FOLDER_PATH;
this.configFilePath = DEFAULT_CONFIG_FILE_PATH;
LOG.error("Config file path is not set. Disabling plugin.");
ConfigStatus.INSTANCE.setConfigurationInvalid();
} else {
this.configFolderPath =
cfPath + File.separator + "opensearch-performance-analyzer" + File.separator;
Expand Down