This repository has been archived by the owner on Aug 2, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add collector time period to rca.conf (#401)
* Add collector time period to rca.conf * Resolve format changes * Resolve format changes * Split config per rca and ability to add predicate for rcaConf * Address PR comments * Add test for rca validation
- Loading branch information
Showing
21 changed files
with
379 additions
and
164 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 0 additions & 54 deletions
54
...java/com/amazon/opendistro/elasticsearch/performanceanalyzer/rca/configs/CacheConfig.java
This file was deleted.
Oops, something went wrong.
63 changes: 63 additions & 0 deletions
63
...zon/opendistro/elasticsearch/performanceanalyzer/rca/configs/FieldDataCacheRcaConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
/* | ||
* Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"). | ||
* You may not use this file except in compliance with the License. | ||
* A copy of the License is located at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* or in the "license" file accompanying this file. This file is distributed | ||
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either | ||
* express or implied. See the License for the specific language governing | ||
* permissions and limitations under the License. | ||
*/ | ||
|
||
package com.amazon.opendistro.elasticsearch.performanceanalyzer.rca.configs; | ||
|
||
import com.amazon.opendistro.elasticsearch.performanceanalyzer.rca.framework.core.RcaConf; | ||
|
||
/** | ||
* config object to store rca config settings for FieldDataCacheRca | ||
*/ | ||
public class FieldDataCacheRcaConfig { | ||
public static final String CONFIG_NAME = "field-data-cache-rca-config"; | ||
|
||
private Double fieldDataCacheSizeThreshold; | ||
private Integer fieldDataCollectorTimePeriodInSec; | ||
|
||
// Field data cache size threshold is 80% | ||
public static final double DEFAULT_FIELD_DATA_CACHE_SIZE_THRESHOLD = 0.8; | ||
// Metrics like eviction, hits are collected every 300 sec in field data cache rca | ||
public static final int DEFAULT_FIELD_DATA_COLLECTOR_TIME_PERIOD_IN_SEC = 300; | ||
|
||
public FieldDataCacheRcaConfig(final RcaConf rcaConf) { | ||
fieldDataCacheSizeThreshold = | ||
rcaConf.readRcaConfig( | ||
CONFIG_NAME, | ||
RCA_CONF_KEY_CONSTANTS.FIELD_DATA_CACHE_SIZE_THRESHOLD, | ||
DEFAULT_FIELD_DATA_CACHE_SIZE_THRESHOLD, | ||
(s) -> (s > 0), | ||
Double.class); | ||
fieldDataCollectorTimePeriodInSec = | ||
rcaConf.readRcaConfig( | ||
CONFIG_NAME, | ||
RCA_CONF_KEY_CONSTANTS.FIELD_DATA_COLLECTOR_TIME_PERIOD_IN_SEC, | ||
DEFAULT_FIELD_DATA_COLLECTOR_TIME_PERIOD_IN_SEC, | ||
(s) -> (s > 0), | ||
Integer.class); | ||
} | ||
|
||
public double getFieldDataCacheSizeThreshold() { | ||
return fieldDataCacheSizeThreshold; | ||
} | ||
|
||
public int getFieldDataCollectorTimePeriodInSec() { | ||
return fieldDataCollectorTimePeriodInSec; | ||
} | ||
|
||
public static class RCA_CONF_KEY_CONSTANTS { | ||
public static final String FIELD_DATA_CACHE_SIZE_THRESHOLD = "field-data-cache-size-threshold"; | ||
public static final String FIELD_DATA_COLLECTOR_TIME_PERIOD_IN_SEC = "field-data-collector-time-period-in-sec"; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
63 changes: 63 additions & 0 deletions
63
.../opendistro/elasticsearch/performanceanalyzer/rca/configs/ShardRequestCacheRcaConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
/* | ||
* Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"). | ||
* You may not use this file except in compliance with the License. | ||
* A copy of the License is located at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* or in the "license" file accompanying this file. This file is distributed | ||
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either | ||
* express or implied. See the License for the specific language governing | ||
* permissions and limitations under the License. | ||
*/ | ||
|
||
package com.amazon.opendistro.elasticsearch.performanceanalyzer.rca.configs; | ||
|
||
import com.amazon.opendistro.elasticsearch.performanceanalyzer.rca.framework.core.RcaConf; | ||
|
||
/** | ||
* config object to store rca config settings for ShardRequestCacheRca | ||
*/ | ||
public class ShardRequestCacheRcaConfig { | ||
public static final String CONFIG_NAME = "shard-request-cache-rca-config"; | ||
|
||
private Double shardRequestCacheSizeThreshold; | ||
private Integer shardRequestCollectorTimePeriodInSec; | ||
|
||
// Shard request cache size threshold is 90% | ||
public static final double DEFAULT_SHARD_REQUEST_CACHE_SIZE_THRESHOLD = 0.9; | ||
// Metrics like eviction, hits are collected every 300 sec in shard request cache rca | ||
public static final int DEFAULT_SHARD_REQUEST_COLLECTOR_TIME_PERIOD_IN_SEC = 300; | ||
|
||
public ShardRequestCacheRcaConfig(final RcaConf rcaConf) { | ||
shardRequestCacheSizeThreshold = | ||
rcaConf.readRcaConfig( | ||
CONFIG_NAME, | ||
RCA_CONF_KEY_CONSTANTS.SHARD_REQUEST_CACHE_SIZE_THRESHOLD, | ||
DEFAULT_SHARD_REQUEST_CACHE_SIZE_THRESHOLD, | ||
(s) -> (s > 0), | ||
Double.class); | ||
shardRequestCollectorTimePeriodInSec = | ||
rcaConf.readRcaConfig( | ||
CONFIG_NAME, | ||
RCA_CONF_KEY_CONSTANTS.SHARD_REQUEST_COLLECTOR_TIME_PERIOD_IN_SEC, | ||
DEFAULT_SHARD_REQUEST_COLLECTOR_TIME_PERIOD_IN_SEC, | ||
(s) -> (s > 0), | ||
Integer.class); | ||
} | ||
|
||
public double getShardRequestCacheSizeThreshold() { | ||
return shardRequestCacheSizeThreshold; | ||
} | ||
|
||
public int getShardRequestCollectorTimePeriodInSec() { | ||
return shardRequestCollectorTimePeriodInSec; | ||
} | ||
|
||
public static class RCA_CONF_KEY_CONSTANTS { | ||
public static final String SHARD_REQUEST_CACHE_SIZE_THRESHOLD = "shard-request-cache-threshold"; | ||
public static final String SHARD_REQUEST_COLLECTOR_TIME_PERIOD_IN_SEC = "shard-request-collector-time-period-in-sec"; | ||
} | ||
} |
Oops, something went wrong.