@Override public Instrumentation createInstrumentation(Method benchmarkMethod) throws InvalidBenchmarkException { checkNotNull(benchmarkMethod); checkArgument(isBenchmarkMethod(benchmarkMethod)); try { switch (BenchmarkMethods.Type.of(benchmarkMethod)) { case MACRO: return new MacroAllocationInstrumentation(benchmarkMethod); case MICRO: case PICO: return new MicroAllocationInstrumentation(benchmarkMethod); default: throw new AssertionError("unknown type"); } } catch (IllegalArgumentException e) { throw new InvalidBenchmarkException("Benchmark methods must have no arguments or accept " + "a single int or long parameter: %s", benchmarkMethod.getName()); } }
@Override public Instrumentation createInstrumentation(Method benchmarkMethod) throws InvalidBenchmarkException { checkNotNull(benchmarkMethod); checkArgument(isBenchmarkMethod(benchmarkMethod)); if (isStatic(benchmarkMethod)) { throw new InvalidBenchmarkException("Benchmark methods must not be static: %s", benchmarkMethod.getName()); } try { switch (BenchmarkMethods.Type.of(benchmarkMethod)) { case MACRO: return new MacrobenchmarkInstrumentation(benchmarkMethod); case MICRO: return new MicrobenchmarkInstrumentation(benchmarkMethod); case PICO: return new PicobenchmarkInstrumentation(benchmarkMethod); default: throw new AssertionError("unknown type"); } } catch (IllegalArgumentException e) { throw new InvalidBenchmarkException("Benchmark methods must have no arguments or accept " + "a single int or long parameter: %s", benchmarkMethod.getName()); } }
@Override public Instrumentation createInstrumentation(Method benchmarkMethod) throws InvalidBenchmarkException { checkNotNull(benchmarkMethod); checkArgument(isBenchmarkMethod(benchmarkMethod)); if (isStatic(benchmarkMethod)) { throw new InvalidBenchmarkException("Benchmark methods must not be static: %s", benchmarkMethod.getName()); } try { switch (BenchmarkMethods.Type.of(benchmarkMethod)) { case MACRO: return new MacrobenchmarkInstrumentation(benchmarkMethod); case MICRO: return new MicrobenchmarkInstrumentation(benchmarkMethod); case PICO: return new PicobenchmarkInstrumentation(benchmarkMethod); default: throw new AssertionError("unknown type"); } } catch (IllegalArgumentException e) { throw new InvalidBenchmarkException("Benchmark methods must have no arguments or accept " + "a single int or long parameter: %s", benchmarkMethod.getName()); } }
@Override public Instrumentation createInstrumentation(Method benchmarkMethod) throws InvalidBenchmarkException { checkNotNull(benchmarkMethod); checkArgument(isBenchmarkMethod(benchmarkMethod)); try { switch (BenchmarkMethods.Type.of(benchmarkMethod)) { case MACRO: return new MacroAllocationInstrumentation(benchmarkMethod); case MICRO: case PICO: return new MicroAllocationInstrumentation(benchmarkMethod); default: throw new AssertionError("unknown type"); } } catch (IllegalArgumentException e) { throw new InvalidBenchmarkException("Benchmark methods must have no arguments or accept " + "a single int or long parameter: %s", benchmarkMethod.getName()); } }