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

[WIP] Added command arguments for getting suggestions from JBrainy

There is probably a better way, since some options are then
invalid
parent d7f1433d
......@@ -32,7 +32,7 @@ class PapiCommandLine : CliktCommand() {
.default("output.csv")
val outputType : String by option("-ot", "--output-type", help = "The data to output about the benchmarks")
.choice("SOFTWARE-COUNTERS", "SOFTWARE-TRACES", "FEATURE-VECTORS")
.choice("SOFTWARE-COUNTERS", "SOFTWARE-TRACES", "FEATURE-VECTORS", "SUGGESTIONS")
.default("SOFTWARE-TRACES")
val numberRuns: Int by option("--number-runs", "-n",
......@@ -68,12 +68,8 @@ class PapiCommandLine : CliktCommand() {
val outputFile = File(outputFileName)
val reader = FileReader(inputFile)
val benchmarks : Stream<BCBenchmarkPackage<*>>? = when (inputType) {
"JMH" -> readJMHData(reader)
"TRACE" -> TraceLoader().readCsv(reader, false)
"TRACE-TSV" -> TraceLoader().readCsv(reader, true)
else -> null
}
val writer = FileWriter(outputFile)
val printer = when(outputType) {
......@@ -86,6 +82,21 @@ class PapiCommandLine : CliktCommand() {
)
SyntheticBenchmarkFeaturePrinter(writer, runner, methodOutputFormat, normalizeFeatures)
}
"SUGGESTIONS" -> { // This is different...
// TODO: The options "-it JMH" and "-ot SUGGESTIONS" won't work together.
val classifier = NaiveClassifier(reader, writer)
classifier.classifyFromReader(inputType == "TRACE-TSV")
exitProcess(0)
}
else -> null
}
// Moved this because we won't load benchmarks the same
// Way if we want suggestions...
val benchmarks : Stream<BCBenchmarkPackage<*>>? = when (inputType) {
"JMH" -> readJMHData(reader)
"TRACE" -> TraceLoader().readCsv(reader, false)
"TRACE-TSV" -> TraceLoader().readCsv(reader, true)
else -> null
}
......
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