Skip to content

Commit

Permalink
Update build.gradle to create sources and javadoc JAR (#25)
Browse files Browse the repository at this point in the history
Signed-off-by: Khushboo Rajput <khushbr@amazon.com>
  • Loading branch information
khushbr committed May 31, 2023
1 parent 3fd0140 commit 169f669
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 13 deletions.
19 changes: 18 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -174,13 +174,29 @@ tasks.withType(Test) {
jvmArgs('--add-opens=java.xml/jdk.xml.internal=ALL-UNNAMED')
}

javadoc {
exclude 'org/opensearch/performanceanalyzer/commons/jvm/**'
}

task sourcesJar(type: Jar) {
archiveClassifier.set("sources")
from sourceSets.main.allJava
}

task javadocJar(type: Jar) {
archiveClassifier.set("javadoc")
from sourceSets.main.allJava
dependsOn javadoc
}

publishing {
publications {
create(MavenPublication) {
groupId = 'org.opensearch'
artifactId = 'performance-analyzer-commons'

from components.java
artifact sourcesJar
artifact javadocJar

pom {
name = "OpenSearch Performance Analyzer Commons"
Expand All @@ -207,6 +223,7 @@ publishing {
}
}
}

repositories {
if (buildVersion.toString().endsWith("SNAPSHOT")) {
maven {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,12 @@ public class PerformanceAnalyzerMetrics {
private static final int sTimeInterval =
MetricsConfiguration.CONFIG_MAP.get(PerformanceAnalyzerMetrics.class).rotationInterval;

/** This method aligns the given time with the ROTATION_INTERVAL */
/**
* This method aligns the given time with the ROTATION_INTERVAL
*
* @param startTime The start time.
* @return Timestamp in long for the interval.
*/
public static long getTimeInterval(long startTime) {
return getTimeInterval(startTime, sTimeInterval);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
*
* <p>Note: The framework also provides the specialized 'Named Counters' at {@link
* ExceptionsAndErrors}. Named Counter take a key with it, and reports the count of occurrences for
* each key. see <a
* href="{@docRoot}/java/org/opensearch/performanceanalyzer/rca/stats/README.md>Stats README</a>.
* each key.
*/
public enum StatExceptionCode {
TOTAL_ERROR("TotalError"),
Expand All @@ -32,22 +31,15 @@ public enum StatExceptionCode {
JVM_THREAD_ID_NO_LONGER_EXISTS("JVMThreadIdNoLongerExists"),

/**
* We start 6 threads within RCA Agent, details at {@link
* org.opensearch.performanceanalyzer.PerformanceAnalyzerThreads}. Below metrics track count of
* thread started and ended.
* We start 6 threads within RCA Agent. Below metrics track count of thread started and ended.
*
* <p>Note: The 'PA' in metricName is confusing, it is meant to imply threads started within RCA
* Agent.
*/
NUM_PA_THREADS_STARTED("NumberOfPAThreadsStarted"),
NUM_PA_THREADS_ENDED("NumberOfPAThreadsEnded"),

/**
* For each thread defined in {@link
* org.opensearch.performanceanalyzer.PerformanceAnalyzerThreads}, we add a respective
* 'threadExceptionCode' metric. These metrics are emitted in catch block of {@link
* org.opensearch.performanceanalyzer.threads.ThreadProvider#createThreadForRunnable}
*/
/** For each thread, we add a respective 'threadExceptionCode' metric. */
READER_THREAD_STOPPED("ReaderThreadStopped"),
ERROR_HANDLER_THREAD_STOPPED("ErrorHandlerThreadStopped"),
GRPC_SERVER_THREAD_STOPPED("GRPCServerThreadStopped"),
Expand Down

0 comments on commit 169f669

Please sign in to comment.