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

Commit

Permalink
Split Elasticsearch version independent code (#75)
Browse files Browse the repository at this point in the history
This commit has 3 major changes -

1) Performance Analyzer code that is Elasticsearch version independent.
3) Performance optimization in the Elasticsearch plugin to emit events
   to a single event log file. This brings down CPU utilization by
   an order of magnitude on large clusters.
  • Loading branch information
Adithya Chandra committed Sep 26, 2019
1 parent 7b1c023 commit 31f2955
Show file tree
Hide file tree
Showing 140 changed files with 885 additions and 15,810 deletions.
9 changes: 5 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ buildscript {
// This isn't applying from repositories.gradle so repeating it here
repositories {
mavenCentral()
mavenLocal()
}

dependencies {
Expand Down Expand Up @@ -92,6 +93,7 @@ project.afterEvaluate {

repositories {
mavenCentral()
mavenLocal()
}


Expand All @@ -114,13 +116,12 @@ dependencies {
all*.exclude group: "org.elasticsearch", module: "securemock"
}

compile 'org.jooq:jooq:3.10.8'
compile 'org.bouncycastle:bcprov-jdk15on:1.60'
compile 'org.bouncycastle:bcpkix-jdk15on:1.60'
compile 'org.xerial:sqlite-jdbc:3.8.11.2'
compile 'com.google.guava:guava:27.0.1-jre'
compile 'org.jooq:jooq:3.10.8'
compile 'com.amazon.opendistro.elasticsearch:performanceanalyzer:1.0';
compile 'com.fasterxml.jackson.core:jackson-annotations:2.8.11'
compile 'com.fasterxml.jackson.core:jackson-databind:2.8.11'
compile 'com.fasterxml.jackson.core:jackson-databind:2.8.11'

// JDK9+ has to run powermock 2+. https://github.com/powermock/powermock/issues/888
testCompile group: 'org.powermock', name: 'powermock-api-mockito2', version: '2.0.0'
Expand Down
14 changes: 0 additions & 14 deletions config/opendistro_performance_analyzer/log4j2.properties

This file was deleted.

1 change: 0 additions & 1 deletion licenses/bcpkix-jdk15on-1.60.jar.sha1

This file was deleted.

12 changes: 0 additions & 12 deletions licenses/bcpkix-jdk15on-LICENSE.txt

This file was deleted.

1 change: 0 additions & 1 deletion licenses/bcprov-jdk15on-1.60.jar.sha1

This file was deleted.

12 changes: 0 additions & 12 deletions licenses/bcprov-jdk15on-LICENSE.txt

This file was deleted.

Empty file removed licenses/bcprov-jdk15on-NOTICE.txt
Empty file.
1 change: 1 addition & 0 deletions licenses/performanceanalyzer-1.0.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
c1334d0a10bde9be7a31fd633afaa22bdfa9ed71
12 changes: 12 additions & 0 deletions licenses/performanceanalyzer-LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License 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.

1 change: 0 additions & 1 deletion licenses/sqlite-jdbc-3.8.11.2.jar.sha1

This file was deleted.

202 changes: 0 additions & 202 deletions licenses/sqlite-jdbc-LICENSE.txt

This file was deleted.

Empty file removed licenses/sqlite-jdbc-NOTICE.txt
Empty file.
8 changes: 4 additions & 4 deletions pa_bin/performance-analyzer-agent
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,18 @@ else
fi

if ! echo $* | grep -E '(^-d |-d$| -d |--daemonize$|--daemonize )' > /dev/null; then
exec $JAVA_HOME/bin/java -Des.path.home=$ES_HOME -Dlog4j.configurationFile=$ES_HOME/plugins/opendistro_performance_analyzer/pa_config/log4j2.xml \
exec $JAVA_HOME/bin/java -Des.path.home=$ES_HOME -Dlog4j.configurationFile=$ES_HOME/opendistro_performance_analyzer/pa_config/log4j2.xml \
-DconfigFilePath=$3 \
-Xms64M -Xmx64M -XX:+UseSerialGC -XX:CICompilerCount=1 -XX:-TieredCompilation -XX:InitialCodeCacheSize=4096 \
-XX:InitialBootClassLoaderMetaspaceSize=30720 -XX:MaxRAM=400m \
-cp $ES_HOME/lib/*:$ES_HOME/plugins/opendistro_performance_analyzer/* com.amazon.opendistro.elasticsearch.performanceanalyzer.PerformanceAnalyzerApp
-cp $ES_HOME/lib/*:$ES_HOME/opendistro_performance_analyzer/* com.amazon.opendistro.elasticsearch.performanceanalyzer.PerformanceAnalyzerApp
else
echo 'Starting deamon'
exec $JAVA_HOME/bin/java -Des.path.home=$ES_HOME -Dlog4j.configurationFile=$ES_HOME/plugins/opendistro_performance_analyzer/pa_config/log4j2.xml \
exec $JAVA_HOME/bin/java -Des.path.home=$ES_HOME -Dlog4j.configurationFile=$ES_HOME/opendistro_performance_analyzer/pa_config/log4j2.xml \
-DconfigFilePath=$3 \
-Xms64M -Xmx64M -XX:+UseSerialGC -XX:CICompilerCount=1 -XX:-TieredCompilation -XX:InitialCodeCacheSize=4096 \
-XX:InitialBootClassLoaderMetaspaceSize=30720 -XX:MaxRAM=400m \
-cp $ES_HOME/lib/*:$ES_HOME/plugins/opendistro_performance_analyzer/* com.amazon.opendistro.elasticsearch.performanceanalyzer.PerformanceAnalyzerApp &
-cp $ES_HOME/lib/*:$ES_HOME/opendistro_performance_analyzer/* com.amazon.opendistro.elasticsearch.performanceanalyzer.PerformanceAnalyzerApp &

pid=$!
PID_LOC=/tmp/performance-analyzer-agent
Expand Down
4 changes: 2 additions & 2 deletions pa_config/log4j2.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<Console name="Console" target="SYSTEM_OUT">
<PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n" />
</Console>
<File name="PerformanceAnalyzerLog" fileName="/tmp/PerformanceAnalyzer.log" immediateFlush="true" append="true">
<File name="PerformanceAnalyzerAgentLog" fileName="/tmp/performance_analyzer_agent.log" immediateFlush="true" append="true">
<PatternLayout pattern="%d{yyy-MM-dd HH:mm:ss.SSS} [PA:Reader] [%t] %-5level %logger{36} - %msg%n"/>
</File>
<File name="StatsLog" fileName="/tmp/performance_analyzer_agent_stats.log" immediateFlush="true" append="true">
Expand All @@ -16,7 +16,7 @@
</Logger>
<Root level="error">
<AppenderRef ref="Console" />
<AppenderRef ref="PerformanceAnalyzerLog"/>
<AppenderRef ref="PerformanceAnalyzerAgentLog"/>
</Root>
</Loggers>
</Configuration>
2 changes: 1 addition & 1 deletion pa_config/supervisord.conf
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@ serverurl=/usr/share/supervisord.sock
files = /etc/supervisor/conf.d/*.conf

[program:performance_analyzer]
command=/usr/share/elasticsearch/plugins/opendistro_performance_analyzer/pa_bin/performance-analyzer-agent /usr/share/elasticsearch
command=/usr/share/elasticsearch/performance-analyzer-rca-1.0.0-SNAPSHOT/bin/performance-analyzer-rca /usr/share/elasticsearch
user=1000
Loading

0 comments on commit 31f2955

Please sign in to comment.