-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
updates gauge usage and added index_uuid as tag
Signed-off-by: Atharva Sharma <[email protected]>
- Loading branch information
1 parent
cb51403
commit d3fda9d
Showing
4 changed files
with
88 additions
and
34 deletions.
There are no files selected for viewing
58 changes: 58 additions & 0 deletions
58
...g/opensearch/performanceanalyzer/collectors/telemetry/RTFCacheConfigMetricsCollector.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,58 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package org.opensearch.performanceanalyzer.collectors.telemetry; | ||
|
||
import org.apache.logging.log4j.LogManager; | ||
import org.apache.logging.log4j.Logger; | ||
import org.opensearch.performanceanalyzer.OpenSearchResources; | ||
import org.opensearch.performanceanalyzer.commons.collectors.PerformanceAnalyzerMetricsCollector; | ||
import org.opensearch.performanceanalyzer.commons.collectors.TelemetryCollector; | ||
import org.opensearch.performanceanalyzer.commons.config.overrides.ConfigOverridesWrapper; | ||
import org.opensearch.performanceanalyzer.commons.metrics.MetricsConfiguration; | ||
import org.opensearch.performanceanalyzer.commons.stats.metrics.StatExceptionCode; | ||
import org.opensearch.performanceanalyzer.commons.stats.metrics.StatMetrics; | ||
import org.opensearch.performanceanalyzer.config.PerformanceAnalyzerController; | ||
import org.opensearch.telemetry.metrics.MetricsRegistry; | ||
|
||
public class RTFCacheConfigMetricsCollector extends PerformanceAnalyzerMetricsCollector | ||
implements TelemetryCollector { | ||
private static final Logger LOG = LogManager.getLogger(RTFCacheConfigMetricsCollector.class); | ||
public static final int SAMPLING_TIME_INTERVAL = | ||
MetricsConfiguration.CONFIG_MAP.get(RTFCacheConfigMetricsCollector.class) | ||
.samplingInterval; | ||
private boolean metricsInitialised; | ||
private PerformanceAnalyzerController performanceAnalyzerController; | ||
private ConfigOverridesWrapper configOverridesWrapper; | ||
private MetricsRegistry metricsRegistry; | ||
|
||
public RTFCacheConfigMetricsCollector( | ||
PerformanceAnalyzerController performanceAnalyzerController, | ||
ConfigOverridesWrapper configOverridesWrapper) { | ||
super( | ||
SAMPLING_TIME_INTERVAL, | ||
"RTFCacheConfigMetricsCollector", | ||
StatMetrics.CACHE_CONFIG_METRICS_COLLECTOR_EXECUTION_TIME, | ||
StatExceptionCode.CACHE_CONFIG_METRICS_COLLECTOR_ERROR); | ||
this.metricsInitialised = false; | ||
this.performanceAnalyzerController = performanceAnalyzerController; | ||
this.configOverridesWrapper = configOverridesWrapper; | ||
} | ||
|
||
@Override | ||
public void collectMetrics(long startTime) { | ||
if (performanceAnalyzerController.isCollectorDisabled( | ||
configOverridesWrapper, getCollectorName())) { | ||
LOG.info("RTFDisksCollector is disabled. Skipping collection."); | ||
return; | ||
} | ||
|
||
metricsRegistry = OpenSearchResources.INSTANCE.getMetricsRegistry(); | ||
if (metricsRegistry == null) { | ||
LOG.error("could not get the instance of MetricsRegistry class"); | ||
return; | ||
} | ||
} | ||
} |
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