Skip to content
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
3 changes: 2 additions & 1 deletion JenkinsfilePerformance
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,8 @@ pipeline {
string(name: 'ADDITIONAL_CMD_ARGS', defaultValue: '', description: '\
Additional command line arguments that one might want to add to the mvn command.<br> \
The contents of this will directly be appended to the mvn command, so write exactly as \
you would if running this manually in a command line (e.g., -Dflag1=true -Dflag2=false ...).')
you would if running this manually in a command line (e.g., -Dflag1=true -Dflag2=false ...).<br> \
Note: You can use -Djmh.threads=X to specify the number of threads for JMH benchmarks (-Djmh.threads=16).')
string(name: 'TIMEOUT_TIME', defaultValue: '48', description: '\
Overall build timeout (HOURS)')
}
Expand Down
18 changes: 16 additions & 2 deletions src/test/java/ibm/jceplus/jmh/JMHBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,29 @@ static Options optionsBuild(String regexClassName, String logFileRoot) {
String ockLibraryPath = System.getProperty("ock.library.path");
String jgskitLibraryPath = System.getProperty("jgskit.library.path");
String osName = System.getProperty("os.name").toLowerCase();
String threadsProperty = System.getProperty("jmh.threads", "1");
int threads;
try {
threads = Integer.parseInt(threadsProperty);
if (threads < 1) {
throw new IllegalArgumentException("Thread count must be at least 1, got: " + threads);
}
} catch (NumberFormatException e) {
throw new IllegalArgumentException("Invalid thread count <" + threadsProperty + ">. Must be an integer.", e);
}
System.out.println("Home dir: " + projectHomeDir);
System.out.println("JGSkit Library Path: " + jgskitLibraryPath);
System.out.println("Regex of classes to run: " + regexClassName);
System.out.println("OS Name: " + osName);
System.out.println("Thread count: " + threads);

String logFileWithThreads = logFileRoot + "-" + threads + "t";

OptionsBuilder optionsBuilder = new OptionsBuilder();
optionsBuilder.threads(threads);
optionsBuilder.include(regexClassName);
optionsBuilder.resultFormat(org.openjdk.jmh.results.format.ResultFormatType.JSON);
optionsBuilder.result(projectHomeDir + "/target/jmh-results/" + logFileRoot + ".json");
optionsBuilder.result(projectHomeDir + "/target/jmh-results/" + logFileWithThreads + ".json");
optionsBuilder.addProfiler(StackProfiler.class);
optionsBuilder.addProfiler(GCProfiler.class);
optionsBuilder.addProfiler(ClassloaderProfiler.class);
Expand All @@ -56,7 +70,7 @@ static Options optionsBuild(String regexClassName, String logFileRoot) {
"-Dock.library.path=" + ockLibraryPath,
"-Djgskit.library.path=" + jgskitLibraryPath);
optionsBuilder.forks(1);
optionsBuilder.output(projectHomeDir + "/target/jmh-results/" + logFileRoot + ".txt");
optionsBuilder.output(projectHomeDir + "/target/jmh-results/" + logFileWithThreads + ".txt");

//TODO Most Jenkins systems dont seem to work with this. Must be admin.
/*
Expand Down