@Provides ImmutableSet<Instrumentation> provideInstrumentations(CaliperOptions options, BenchmarkClass benchmarkClass, ImmutableSet<Instrument> instruments) throws InvalidBenchmarkException { ImmutableSet.Builder<Instrumentation> builder = ImmutableSet.builder(); ImmutableSet<String> benchmarkMethodNames = options.benchmarkMethodNames(); for (Instrument instrument : instruments) { for (Method method : findAllBenchmarkMethods(benchmarkClass.benchmarkClass(), instrument)) { if (benchmarkMethodNames.isEmpty() || benchmarkMethodNames.contains(method.getName())) { builder.add(instrument.createInstrumentation(method)); } } } return builder.build(); }
@Provides ImmutableSet<Instrumentation> provideInstrumentations(CaliperOptions options, BenchmarkClass benchmarkClass, ImmutableSet<Instrument> instruments) throws InvalidBenchmarkException { ImmutableSet.Builder<Instrumentation> builder = ImmutableSet.builder(); ImmutableSet<String> benchmarkMethodNames = options.benchmarkMethodNames(); Set<String> unusedBenchmarkNames = new HashSet<String>(benchmarkMethodNames); for (Instrument instrument : instruments) { for (Method method : findAllBenchmarkMethods(benchmarkClass.benchmarkClass(), instrument)) { if (benchmarkMethodNames.isEmpty() || benchmarkMethodNames.contains(method.getName())) { builder.add(instrument.createInstrumentation(method)); unusedBenchmarkNames.remove(method.getName()); } } } if (!unusedBenchmarkNames.isEmpty()) { throw new InvalidBenchmarkException( "Invalid benchmark method(s) specified in options: " + unusedBenchmarkNames); } return builder.build(); }
ImmutableSet.Builder<Experiment> builder = ImmutableSet.builder(); for (Experiment experiment : experiments) { Class<?> clazz = benchmarkClass.benchmarkClass(); try { Object benchmark = injector.createChildInjector(ExperimentModule.forExperiment(experiment))
ImmutableSet.Builder<Experiment> builder = ImmutableSet.builder(); for (Experiment experiment : experiments) { Class<?> clazz = benchmarkClass.benchmarkClass(); try { Object benchmark = injector.createChildInjector(ExperimentModule.forExperiment(experiment))
throw new InvalidBenchmarkException( "There were no experiments to be performed for the class %s using the instruments %s", benchmarkClass.benchmarkClass().getSimpleName(), instruments);
throw new InvalidBenchmarkException( "There were no experiments to be performed for the class %s using the instruments %s", benchmarkClass.benchmarkClass().getSimpleName(), instruments);