Skip to content
Snippets Groups Projects
Commit 2f8b54a3 authored by Reiner Jung's avatar Reiner Jung
Browse files

Updated compile results.

parent 90ea86e2
No related branches found
No related tags found
No related merge requests found
experiment.rc
\ No newline at end of file
test.rc
\ No newline at end of file
......@@ -90,10 +90,12 @@ print(resultstext)
currentTime <- as.numeric(Sys.time())
write(paste(configs.framework_name, ":"), file=out_yaml_fn,append=FALSE)
write(paste("- timestamp:", currentTime), file=out_yaml_fn, append=TRUE)
write(paste("kind:", configs.framework_name), file=out_yaml_fn,append=FALSE)
write("experiments:", file=out_yaml_fn, append=TRUE)
write(paste("- timestamp:", currentTime), file=out_yaml_fn, append=TRUE)
write(" measurements:", file=out_yaml_fn, append=TRUE)
for (writer_idx in (1:(numberOfWriters))) {
write(paste(" ", configs.labels[writer_idx], ": [",
write(paste(" ", configs.labels[writer_idx], ": [",
format(printvalues["mean",writer_idx], scientific=TRUE), ",",
format(printvalues["sd",writer_idx], scientific=TRUE), ",",
format(printvalues["ci95%",writer_idx], scientific=TRUE), ",",
......
......@@ -18,4 +18,5 @@ dependencies {
implementation 'net.kieker-monitoring:kieker:2.0.0-SNAPSHOT'
implementation 'net.sourceforge.teetime:teetime:3.1-SNAPSHOT'
implementation 'com.beust:jcommander:1.78'
implementation 'org.yaml:snakeyaml:1.30'
}
package moobench.tools.results;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import com.fasterxml.jackson.databind.JsonNode;
import teetime.stage.basic.AbstractFilter;
public class MakeWindowStage extends AbstractFilter<List<Map<String, JsonNode>>> {
private Integer window;
public MakeWindowStage(Integer window) {
this.window = window;
}
@Override
protected void execute(List<Map<String, JsonNode>> list) throws Exception {
List<Map<String, JsonNode>> newList = new ArrayList<Map<String, JsonNode>>();
for (int i=list.size()-window-1;i < list.size();i++) {
newList.add(list.get(i));
}
this.outputPort.send(newList);
}
}
package moobench.tools.results;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.commons.csv.CSVFormat;
import org.apache.commons.csv.CSVParser;
import org.apache.commons.csv.CSVRecord;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.node.DoubleNode;
import teetime.framework.AbstractConsumerStage;
import teetime.framework.OutputPort;
public class ReadCsvFileSource extends AbstractConsumerStage<Path> {
private final OutputPort<Map<String, JsonNode>> outputPort = this.createOutputPort();
@Override
protected void execute(Path path) throws Exception {
final CSVParser csvParser = new CSVParser(Files.newBufferedReader(path),
CSVFormat.DEFAULT.withHeader());
List<String> header = csvParser.getHeaderNames();
Map<String, JsonNode> recordMap = new HashMap<>();
CSVRecord record = csvParser.getRecords().get(0);
for (int i=0;i<header.size();i++) {
String value = record.get(header.get(i));
recordMap.put(header.get(i).trim(), new DoubleNode(Double.parseDouble(value)));
}
csvParser.close();
this.outputPort.send(recordMap);
}
public OutputPort<Map<String, JsonNode>> getOutputPort() {
return this.outputPort;
}
}
......@@ -9,35 +9,35 @@ import com.beust.jcommander.converters.PathConverter;
public class Settings {
@Parameter(names= { "-l", "--main-log" }, required = true, converter = PathConverter.class, description = "Main log file")
private Path mainLogJson;
@Parameter(names = { "-i", "--input" }, variableArity = true, required = true, converter = PathConverter.class, description = "List of input data sets")
private List<Path> inputPaths;
@Parameter(names= { "-p", "--partial-log" }, required = true, converter = PathConverter.class, description = "Partial log file")
private Path partialLogJson;
@Parameter(names= { "-l", "--log" }, required = true, converter = PathConverter.class, description = "YAML log file root path")
private Path logPath;
@Parameter(names= { "-d", "--result-data" }, variableArity = true, required = true, converter = PathConverter.class, description = "Collection of experiment data")
private List<Path> resultCsvPaths;
@Parameter(names= { "-t", "--table" }, required = true, converter = PathConverter.class, description = "Output HTML table for results")
private Path tablePath;
@Parameter(names= { "-m", "--mapping-file" }, required = true, converter = PathConverter.class, description = "Experiment Result to log mapping")
private Path mappingFile;
@Parameter(names= { "-j", "--json-log" }, required = true, converter = PathConverter.class, description = "Partial JSON log for viewing")
private Path jsonLogPath;
@Parameter(names= { "-w", "--window" }, required = true, description = "Time Window Size")
private Integer window;
public Path getMainLogJson() {
return mainLogJson;
public List<Path> getInputPaths() {
return inputPaths;
}
public Path getPartialLogJson() {
return partialLogJson;
public Path getLogPath() {
return logPath;
}
public List<Path> getResultCsvPaths() {
return resultCsvPaths;
public Path getTablePath() {
return tablePath;
}
public Path getMappingFile() {
return mappingFile;
public Path getJsonLogPath() {
return jsonLogPath;
}
public Integer getWindow() {
......
package moobench.tools.results;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
......@@ -12,29 +14,29 @@ import teetime.stage.basic.distributor.strategy.CopyByReferenceStrategy;
public class TeetimeConfiguration extends Configuration {
public TeetimeConfiguration(Settings settings) {
MainLogReader mainLogReader = new MainLogReader(settings.getMainLogJson());
MappingFileReader mappingFileReader = new MappingFileReader(settings.getMappingFile());
SpecialArrayElementStage arrayElementStage = new SpecialArrayElementStage(settings.getResultCsvPaths());
ReadCsvFileSource readCsvFileSource = new ReadCsvFileSource();
MergeDataStage mergeDataStage = new MergeDataStage();
mergeDataStage.declareActive();
Distributor<List<Map<String, JsonNode>>> distributor = new Distributor<>(new CopyByReferenceStrategy());
LogWriter mainLogWriter = new LogWriter(settings.getMainLogJson());
MakeWindowStage makeWindowStage = new MakeWindowStage(settings.getWindow());
LogWriter partialLogWriter = new LogWriter(settings.getPartialLogJson());
this.connectPorts(mainLogReader.getOutputPort(), mergeDataStage.getMainLogInputPort());
this.connectPorts(mappingFileReader.getOutputPort(), mergeDataStage.getMappingInputPort());
this.connectPorts(arrayElementStage.getOutputPort(), readCsvFileSource.getInputPort());
this.connectPorts(readCsvFileSource.getOutputPort(), mergeDataStage.getNewDataInputPort());
this.connectPorts(mergeDataStage.getOutputPort(), distributor.getInputPort());
this.connectPorts(distributor.getNewOutputPort(), mainLogWriter.getInputPort());
this.connectPorts(distributor.getNewOutputPort(), makeWindowStage.getInputPort());
this.connectPorts(makeWindowStage.getOutputPort(), partialLogWriter.getInputPort());
List<Path> logFilePaths = new ArrayList<Path>();
for (Path path : settings.getInputPaths()) {
logFilePaths.add(settings.getLogPath().resolve(path.getFileName()));
}
ElementProducer<Path> yamlInputPathsProducer = new ElementProducer<>(settings.getInputPaths());
ElementProducer<Path> yamlLogPathsProducer = new ElementProducer<>(logFilePaths);
LogAppender :: logAppender
Distributor :: distributor
YamlLogSink :: yamlLogSink
ChartAssemblerStage :: chartAssemblerStage
JsonLogSink :: jsonLogSink
GenerateHtmlTable :: generateHtmlTable
FileSink :: fileSink
yamlInputPathsProducer -> logAppender.newRecord
yamlLogPathsProducer -> logAppender.log
logAppender.output -- log -> distributor
distributor -> yamlLogSink
distributor -> chartAssemblerStage -> jsonLogSink
distributor -> generateHtmlTable -> fileSink
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment