Write out the results for a benchmark run to a bunch of files @param r @param activeTXTypes @param argsLine @param xmlConfig @throws Exception
(
Results r,
List<TransactionType> activeTXTypes,
CommandLine argsLine,
XMLConfiguration xmlConfig)
| 693 | * @throws Exception |
| 694 | */ |
| 695 | private static void writeOutputs( |
| 696 | Results r, |
| 697 | List<TransactionType> activeTXTypes, |
| 698 | CommandLine argsLine, |
| 699 | XMLConfiguration xmlConfig) |
| 700 | throws Exception { |
| 701 | |
| 702 | // If an output directory is used, store the information |
| 703 | String outputDirectory = "results"; |
| 704 | |
| 705 | if (argsLine.hasOption("d")) { |
| 706 | outputDirectory = argsLine.getOptionValue("d"); |
| 707 | } |
| 708 | |
| 709 | FileUtil.makeDirIfNotExists(outputDirectory); |
| 710 | ResultWriter rw = new ResultWriter(r, xmlConfig, argsLine); |
| 711 | |
| 712 | String name = StringUtils.join(StringUtils.split(argsLine.getOptionValue("b"), ','), '-'); |
| 713 | |
| 714 | String baseFileName = name + "_" + TimeUtil.getCurrentTimeString(); |
| 715 | |
| 716 | int windowSize = Integer.parseInt(argsLine.getOptionValue("s", "5")); |
| 717 | |
| 718 | String rawFileName = baseFileName + ".raw.csv"; |
| 719 | try (PrintStream ps = new PrintStream(FileUtil.joinPath(outputDirectory, rawFileName))) { |
| 720 | LOG.info("Output Raw data into file: {}", rawFileName); |
| 721 | rw.writeRaw(activeTXTypes, ps); |
| 722 | } |
| 723 | |
| 724 | String sampleFileName = baseFileName + ".samples.csv"; |
| 725 | try (PrintStream ps = new PrintStream(FileUtil.joinPath(outputDirectory, sampleFileName))) { |
| 726 | LOG.info("Output samples into file: {}", sampleFileName); |
| 727 | rw.writeSamples(ps); |
| 728 | } |
| 729 | |
| 730 | String summaryFileName = baseFileName + ".summary.json"; |
| 731 | try (PrintStream ps = new PrintStream(FileUtil.joinPath(outputDirectory, summaryFileName))) { |
| 732 | LOG.info("Output summary data into file: {}", summaryFileName); |
| 733 | rw.writeSummary(ps); |
| 734 | } |
| 735 | |
| 736 | String paramsFileName = baseFileName + ".params.json"; |
| 737 | try (PrintStream ps = new PrintStream(FileUtil.joinPath(outputDirectory, paramsFileName))) { |
| 738 | LOG.info("Output DBMS parameters into file: {}", paramsFileName); |
| 739 | rw.writeParams(ps); |
| 740 | } |
| 741 | |
| 742 | if (rw.hasMetrics()) { |
| 743 | String metricsFileName = baseFileName + ".metrics.json"; |
| 744 | try (PrintStream ps = new PrintStream(FileUtil.joinPath(outputDirectory, metricsFileName))) { |
| 745 | LOG.info("Output DBMS metrics into file: {}", metricsFileName); |
| 746 | rw.writeMetrics(ps); |
| 747 | } |
| 748 | } |
| 749 | |
| 750 | String configFileName = baseFileName + ".config.xml"; |
| 751 | try (PrintStream ps = new PrintStream(FileUtil.joinPath(outputDirectory, configFileName))) { |
| 752 | LOG.info("Output benchmark config into file: {}", configFileName); |
no test coverage detected