diff --git a/src/main/java/org/opensearch/performanceanalyzer/PerformanceAnalyzerPlugin.java b/src/main/java/org/opensearch/performanceanalyzer/PerformanceAnalyzerPlugin.java index 089cf3a7..47708c9e 100644 --- a/src/main/java/org/opensearch/performanceanalyzer/PerformanceAnalyzerPlugin.java +++ b/src/main/java/org/opensearch/performanceanalyzer/PerformanceAnalyzerPlugin.java @@ -41,13 +41,32 @@ import org.opensearch.env.NodeEnvironment; import org.opensearch.index.IndexModule; import org.opensearch.performanceanalyzer.action.PerformanceAnalyzerActionFilter; -import org.opensearch.performanceanalyzer.collectors.*; +import org.opensearch.performanceanalyzer.collectors.AdmissionControlMetricsCollector; +import org.opensearch.performanceanalyzer.collectors.CacheConfigMetricsCollector; +import org.opensearch.performanceanalyzer.collectors.CircuitBreakerCollector; +import org.opensearch.performanceanalyzer.collectors.ClusterApplierServiceStatsCollector; +import org.opensearch.performanceanalyzer.collectors.ClusterManagerServiceEventMetrics; +import org.opensearch.performanceanalyzer.collectors.ClusterManagerServiceMetrics; +import org.opensearch.performanceanalyzer.collectors.ElectionTermCollector; +import org.opensearch.performanceanalyzer.collectors.FaultDetectionMetricsCollector; +import org.opensearch.performanceanalyzer.collectors.NodeDetailsCollector; +import org.opensearch.performanceanalyzer.collectors.NodeStatsAllShardsMetricsCollector; +import org.opensearch.performanceanalyzer.collectors.SearchBackPressureStatsCollector; +import org.opensearch.performanceanalyzer.collectors.ShardIndexingPressureMetricsCollector; +import org.opensearch.performanceanalyzer.collectors.ShardStateCollector; +import org.opensearch.performanceanalyzer.collectors.ThreadPoolMetricsCollector; import org.opensearch.performanceanalyzer.collectors.telemetry.RTFDisksCollector; import org.opensearch.performanceanalyzer.collectors.telemetry.RTFHeapMetricsCollector; import org.opensearch.performanceanalyzer.collectors.telemetry.RTFNodeStatsAllShardsMetricsCollector; import org.opensearch.performanceanalyzer.collectors.telemetry.RTFThreadPoolMetricsCollector; import org.opensearch.performanceanalyzer.commons.OSMetricsGeneratorFactory; -import org.opensearch.performanceanalyzer.commons.collectors.*; +import org.opensearch.performanceanalyzer.commons.collectors.DisksCollector; +import org.opensearch.performanceanalyzer.commons.collectors.GCInfoCollector; +import org.opensearch.performanceanalyzer.commons.collectors.HeapMetricsCollector; +import org.opensearch.performanceanalyzer.commons.collectors.NetworkInterfaceCollector; +import org.opensearch.performanceanalyzer.commons.collectors.OSMetricsCollector; +import org.opensearch.performanceanalyzer.commons.collectors.ScheduledMetricCollectorsExecutor; +import org.opensearch.performanceanalyzer.commons.collectors.StatsCollector; import org.opensearch.performanceanalyzer.commons.config.PluginSettings; import org.opensearch.performanceanalyzer.commons.config.overrides.ConfigOverridesWrapper; import org.opensearch.performanceanalyzer.commons.event_process.EventLog; diff --git a/src/main/java/org/opensearch/performanceanalyzer/collectors/telemetry/RTFDisksCollector.java b/src/main/java/org/opensearch/performanceanalyzer/collectors/telemetry/RTFDisksCollector.java index bb186f0f..d0ae78a6 100644 --- a/src/main/java/org/opensearch/performanceanalyzer/collectors/telemetry/RTFDisksCollector.java +++ b/src/main/java/org/opensearch/performanceanalyzer/collectors/telemetry/RTFDisksCollector.java @@ -84,12 +84,12 @@ configOverridesWrapper, getCollectorName())) { public void recordMetrics(DiskMetricsGenerator diskMetricsGenerator) { for (String disk : diskMetricsGenerator.getAllDisks()) { Tags diskNameTag = Tags.create().addTag("disk_name", disk); - double Disk_WaitTime = diskMetricsGenerator.getAwait(disk); - double Disk_ServiceRate = diskMetricsGenerator.getServiceRate(disk); - double Disk_Utilization = diskMetricsGenerator.getDiskUtilization(disk); - diskWaitTimeMetrics.record(Disk_WaitTime, diskNameTag); - diskUtilizationMetrics.record(Disk_Utilization, diskNameTag); - diskServiceRateMetrics.record(Disk_ServiceRate, diskNameTag); + double diskWaitTime = diskMetricsGenerator.getAwait(disk); + double diskServiceRate = diskMetricsGenerator.getServiceRate(disk); + double diskUtilization = diskMetricsGenerator.getDiskUtilization(disk); + diskWaitTimeMetrics.record(diskWaitTime, diskNameTag); + diskUtilizationMetrics.record(diskUtilization, diskNameTag); + diskServiceRateMetrics.record(diskServiceRate, diskNameTag); } } diff --git a/src/main/java/org/opensearch/performanceanalyzer/config/setting/PerformanceAnalyzerClusterSettings.java b/src/main/java/org/opensearch/performanceanalyzer/config/setting/PerformanceAnalyzerClusterSettings.java index d7495b87..636b1518 100644 --- a/src/main/java/org/opensearch/performanceanalyzer/config/setting/PerformanceAnalyzerClusterSettings.java +++ b/src/main/java/org/opensearch/performanceanalyzer/config/setting/PerformanceAnalyzerClusterSettings.java @@ -39,6 +39,7 @@ public enum PerformanceAnalyzerFeatureBits { Setting.Property.NodeScope, Setting.Property.Dynamic); + /** Cluster setting controlling TELEMETRY/RCA/BOTH/NONE collectors enabled. */ public static final Setting PA_COLLECTORS_SETTING = Setting.intSetting( "cluster.metadata.perf_analyzer.collectors.enabled", diff --git a/src/main/java/org/opensearch/performanceanalyzer/config/setting/handler/PerformanceAnalyzerCollectorsSettingHandler.java b/src/main/java/org/opensearch/performanceanalyzer/config/setting/handler/PerformanceAnalyzerCollectorsSettingHandler.java index e5d4ed12..8fa7f5cd 100644 --- a/src/main/java/org/opensearch/performanceanalyzer/config/setting/handler/PerformanceAnalyzerCollectorsSettingHandler.java +++ b/src/main/java/org/opensearch/performanceanalyzer/config/setting/handler/PerformanceAnalyzerCollectorsSettingHandler.java @@ -30,6 +30,12 @@ public void updateCollectorsSetting(final int value) { PerformanceAnalyzerClusterSettings.PA_COLLECTORS_SETTING, value); } + /** + * Handler that gets called when there is a new value for the setting that this listener is + * listening to. + * + * @param newSettingValue The value of the new setting. + */ @Override public void onSettingUpdate(final Integer newSettingValue) { if (newSettingValue != null) {