Gitlab service upgraded. Please report any problems to dl_gitadmin@cs.lth.se

Commit 2a7550d6 authored by Noric Couderc's avatar Noric Couderc

Added commit hash to data file names

Makes it easier to get the configuration back when looking at data
files.
parent 922a140f
......@@ -60,7 +60,9 @@ test {
dependencies {
// The production code uses the SLF4J logging API at compile time
compile 'org.slf4j:slf4j-api:1.7.13'
compile 'org.slf4j:slf4j-simple:1.7.13'
compile files('lib/papi.jar')
compile 'org.eclipse.jgit:org.eclipse.jgit:5.2.1.201812262042-r'
implementation 'com.google.code.gson:gson:2.8.5'
// Declare the dependency for your favourite test framework you want to use in your tests.
......
......@@ -9,6 +9,11 @@ import org.openjdk.jmh.runner.options.Options;
import org.openjdk.jmh.runner.options.OptionsBuilder;
import org.openjdk.jmh.runner.options.TimeValue;
import java.io.IOException;
import org.eclipse.jgit.internal.storage.file.FileRepository;
import org.eclipse.jgit.lib.ObjectId;
import org.eclipse.jgit.api.Git;
import java.util.*;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
......@@ -51,7 +56,18 @@ public class Main {
System.out.println(new Gson().toJson(seedsToDatastructure));
}
public static void main(String[] args) throws RunnerException {
public static String getCommit() {
try {
FileRepository localRepo = new FileRepository(".git");
ObjectId o = localRepo.findRef("HEAD").getTarget().getObjectId();
return ObjectId.toString(o).substring(0, 8);
} catch (IOException e) {
System.err.println(e.getMessage());
}
return "Unable to fetch commit";
}
public static void main(String[] args) throws RunnerException, IOException {
System.out.println("Running the custom jmh runner.");
// Preparing seeds
int number_seeds = 20;
......@@ -71,7 +87,7 @@ public class Main {
.measurementTime(TimeValue.milliseconds(mt))
.measurementIterations(5)
.resultFormat(ResultFormatType.CSV)
.result(String.format("jmh-results-runner-mt=%d.csv", mt))
.result(String.format("jmh-results-%s-runner-mt=%d.csv", getCommit(), mt))
.param("seed", seedsText)
.param("baseStructureSize", "0", "1000", "10000")
.param("applicationSize", "10", "100", "1000")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment