Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update build.gradle to create sources and javadoc JAR #25

Merged
merged 1 commit into from
May 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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