@Override public String toString() { return name(); }
@Override public String toString() { return name(); }
@VisibleForTesting static List<String> getJvmArgs(VirtualMachine vm, BenchmarkClass benchmarkClass) { List<String> args = Lists.newArrayList(); String jdkPath = vm.config.javaExecutable().getAbsolutePath(); args.add(jdkPath); logger.fine(String.format("Java(%s) Path: %s", vm.name, jdkPath)); ImmutableList<String> jvmOptions = vm.config.options(); args.addAll(jvmOptions); logger.fine(String.format("Java(%s) args: %s", vm.name, jvmOptions)); ImmutableSet<String> benchmarkJvmOptions = benchmarkClass.vmOptions(); args.addAll(benchmarkJvmOptions); logger.fine(String.format("Benchmark(%s) Java args: %s", benchmarkClass.name(), benchmarkJvmOptions)); String classPath = getClassPath(); Collections.addAll(args, "-cp", classPath); logger.finer(String.format("Class path: %s", classPath)); return args; }
@VisibleForTesting static List<String> getJvmArgs(VirtualMachine vm, BenchmarkClass benchmarkClass) { List<String> args = Lists.newArrayList(); String jdkPath = vm.config.javaExecutable().getAbsolutePath(); args.add(jdkPath); logger.fine(String.format("Java(%s) Path: %s", vm.name, jdkPath)); ImmutableList<String> jvmOptions = vm.config.options(); args.addAll(jvmOptions); logger.fine(String.format("Java(%s) args: %s", vm.name, jvmOptions)); ImmutableSet<String> benchmarkJvmOptions = benchmarkClass.vmOptions(); args.addAll(benchmarkJvmOptions); logger.fine(String.format("Benchmark(%s) Java args: %s", benchmarkClass.name(), benchmarkJvmOptions)); String classPath = getClassPath(); Collections.addAll(args, "-cp", classPath); logger.finer(String.format("Class path: %s", classPath)); return args; }
@Inject OutputFileDumper(Run run, BenchmarkClass benchmarkClass, Gson gson, CaliperConfig caliperConfig, @CaliperDirectory File caliperDirectory) throws InvalidConfigurationException { this.run = run; ResultProcessorConfig config = caliperConfig.getResultProcessorConfig(OutputFileDumper.class); if (config.options().containsKey("file")) { this.resultFile = new File(config.options().get("file")); logger.finer("found an output file in the configuration"); } else if (config.options().containsKey("dir")) { File dir = new File(config.options().get("dir")); if (dir.isFile()) { throw new InvalidConfigurationException("specified a directory, but it's a file"); } this.resultFile = new File(dir, createFileName(benchmarkClass.name())); logger.finer("found an output directory in the configuration"); } else { this.resultFile = new File(new File(caliperDirectory, "results"), createFileName(benchmarkClass.name())); logger.fine("found no configuration"); } logger.fine(String.format("using %s for results", resultFile)); this.gson = gson; this.workFile = new File(resultFile.getPath() + ".tmp"); }
@Inject OutputFileDumper(Run run, BenchmarkClass benchmarkClass, Gson gson, CaliperConfig caliperConfig, @CaliperDirectory File caliperDirectory) throws InvalidConfigurationException { this.run = run; ResultProcessorConfig config = caliperConfig.getResultProcessorConfig(OutputFileDumper.class); if (config.options().containsKey("file")) { this.resultFile = new File(config.options().get("file")); logger.finer("found an output file in the configuration"); } else if (config.options().containsKey("dir")) { File dir = new File(config.options().get("dir")); if (dir.isFile()) { throw new InvalidConfigurationException("specified a directory, but it's a file"); } this.resultFile = new File(dir, createFileName(benchmarkClass.name())); logger.finer("found an output directory in the configuration"); } else { this.resultFile = new File(new File(caliperDirectory, "results"), createFileName(benchmarkClass.name())); logger.fine("found no configuration"); } logger.fine(String.format("using %s for results", resultFile)); this.gson = gson; this.workFile = new File(resultFile.getPath() + ".tmp"); }