Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Commit

Permalink
Configure cloneGitRepo task to use default git branch
Browse files Browse the repository at this point in the history
  • Loading branch information
jotok committed Mar 8, 2021
1 parent cc24d99 commit 8210400
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 27 deletions.
4 changes: 3 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ buildscript {

ext {
es_version = System.getProperty("es.version", "7.10.2")
gitDefaultBranch = 'main'
}
// This isn't applying from repositories.gradle so repeating it here
repositories {
Expand Down Expand Up @@ -78,7 +79,7 @@ apply plugin: 'com.diffplug.spotless'
spotless {
java {
// only apply formatting rules to updated files
ratchetFrom 'origin/main'
ratchetFrom "origin/${gitDefaultBranch}"

licenseHeaderFile(file('license-header'))
googleJavaFormat()
Expand Down Expand Up @@ -309,6 +310,7 @@ task cloneGitRepo(type: GitClone) {
rcaDir = Paths.get(getProject().getBuildDir().toString(), "performance-analyzer-rca").toString()
def destination = file(rcaDir)
uri = "https://github.com/opendistro-for-elasticsearch/performance-analyzer-rca.git"
branch = gitDefaultBranch
destinationPath = destination
bare = false
enabled = !destination.exists() // to clone only once
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import com.amazon.opendistro.elasticsearch.performanceanalyzer.collectors.FaultDetectionMetricsCollector;
import com.amazon.opendistro.elasticsearch.performanceanalyzer.collectors.GCInfoCollector;
import com.amazon.opendistro.elasticsearch.performanceanalyzer.collectors.HeapMetricsCollector;
import com.amazon.opendistro.elasticsearch.performanceanalyzer.collectors.ShardIndexingPressureMetricsCollector;
import com.amazon.opendistro.elasticsearch.performanceanalyzer.collectors.MasterServiceEventMetrics;
import com.amazon.opendistro.elasticsearch.performanceanalyzer.collectors.MasterServiceMetrics;
import com.amazon.opendistro.elasticsearch.performanceanalyzer.collectors.MasterThrottlingMetricsCollector;
Expand All @@ -35,6 +34,7 @@
import com.amazon.opendistro.elasticsearch.performanceanalyzer.collectors.NodeStatsFixedShardsMetricsCollector;
import com.amazon.opendistro.elasticsearch.performanceanalyzer.collectors.OSMetricsCollector;
import com.amazon.opendistro.elasticsearch.performanceanalyzer.collectors.ScheduledMetricCollectorsExecutor;
import com.amazon.opendistro.elasticsearch.performanceanalyzer.collectors.ShardIndexingPressureMetricsCollector;
import com.amazon.opendistro.elasticsearch.performanceanalyzer.collectors.ShardStateCollector;
import com.amazon.opendistro.elasticsearch.performanceanalyzer.collectors.StatsCollector;
import com.amazon.opendistro.elasticsearch.performanceanalyzer.collectors.ThreadPoolMetricsCollector;
Expand Down Expand Up @@ -206,31 +206,35 @@ public PerformanceAnalyzerPlugin(final Settings settings, final java.nio.file.Pa

scheduledMetricCollectorsExecutor.addScheduledMetricCollector(new MetricsPurgeActivity());

scheduledMetricCollectorsExecutor.addScheduledMetricCollector(new NodeDetailsCollector(configOverridesWrapper));
scheduledMetricCollectorsExecutor.addScheduledMetricCollector(new
NodeStatsAllShardsMetricsCollector(performanceAnalyzerController));
scheduledMetricCollectorsExecutor.addScheduledMetricCollector(new
NodeStatsFixedShardsMetricsCollector(performanceAnalyzerController));
scheduledMetricCollectorsExecutor.addScheduledMetricCollector(new MasterServiceMetrics());
scheduledMetricCollectorsExecutor.addScheduledMetricCollector(new MasterServiceEventMetrics());
scheduledMetricCollectorsExecutor.addScheduledMetricCollector(new DisksCollector());
scheduledMetricCollectorsExecutor.addScheduledMetricCollector(new NetworkInterfaceCollector());
scheduledMetricCollectorsExecutor.addScheduledMetricCollector(new GCInfoCollector());
scheduledMetricCollectorsExecutor.addScheduledMetricCollector(StatsCollector.instance());
scheduledMetricCollectorsExecutor.addScheduledMetricCollector(new FaultDetectionMetricsCollector(
performanceAnalyzerController, configOverridesWrapper));
scheduledMetricCollectorsExecutor.addScheduledMetricCollector(new ShardStateCollector(
performanceAnalyzerController,configOverridesWrapper));
scheduledMetricCollectorsExecutor.addScheduledMetricCollector(new MasterThrottlingMetricsCollector(
performanceAnalyzerController,configOverridesWrapper));
try {
Class.forName(ShardIndexingPressureMetricsCollector.SHARD_INDEXING_PRESSURE_CLASS_NAME);
scheduledMetricCollectorsExecutor.addScheduledMetricCollector(new ShardIndexingPressureMetricsCollector(
performanceAnalyzerController,configOverridesWrapper));
} catch (ClassNotFoundException e) {
LOG.info("Shard IndexingPressure not present in this ES version. Skipping ShardIndexingPressureMetricsCollector");
}
scheduledMetricCollectorsExecutor.start();
scheduledMetricCollectorsExecutor.addScheduledMetricCollector(
new NodeDetailsCollector(configOverridesWrapper));
scheduledMetricCollectorsExecutor.addScheduledMetricCollector(
new NodeStatsAllShardsMetricsCollector(performanceAnalyzerController));
scheduledMetricCollectorsExecutor.addScheduledMetricCollector(
new NodeStatsFixedShardsMetricsCollector(performanceAnalyzerController));
scheduledMetricCollectorsExecutor.addScheduledMetricCollector(new MasterServiceMetrics());
scheduledMetricCollectorsExecutor.addScheduledMetricCollector(new MasterServiceEventMetrics());
scheduledMetricCollectorsExecutor.addScheduledMetricCollector(new DisksCollector());
scheduledMetricCollectorsExecutor.addScheduledMetricCollector(new NetworkInterfaceCollector());
scheduledMetricCollectorsExecutor.addScheduledMetricCollector(new GCInfoCollector());
scheduledMetricCollectorsExecutor.addScheduledMetricCollector(StatsCollector.instance());
scheduledMetricCollectorsExecutor.addScheduledMetricCollector(
new FaultDetectionMetricsCollector(performanceAnalyzerController, configOverridesWrapper));
scheduledMetricCollectorsExecutor.addScheduledMetricCollector(
new ShardStateCollector(performanceAnalyzerController, configOverridesWrapper));
scheduledMetricCollectorsExecutor.addScheduledMetricCollector(
new MasterThrottlingMetricsCollector(
performanceAnalyzerController, configOverridesWrapper));
try {
Class.forName(ShardIndexingPressureMetricsCollector.SHARD_INDEXING_PRESSURE_CLASS_NAME);
scheduledMetricCollectorsExecutor.addScheduledMetricCollector(
new ShardIndexingPressureMetricsCollector(
performanceAnalyzerController, configOverridesWrapper));
} catch (ClassNotFoundException e) {
LOG.info(
"Shard IndexingPressure not present in this ES version. Skipping ShardIndexingPressureMetricsCollector");
}
scheduledMetricCollectorsExecutor.start();

EventLog eventLog = new EventLog();
EventLogFileHandler eventLogFileHandler =
Expand Down

0 comments on commit 8210400

Please sign in to comment.