Package com.google.caliper.runner.Instrument

Examples of com.google.caliper.runner.Instrument.Instrumentation


            .toSet());
  }

  @Test public void createInstrumentation_macrobenchmark() throws Exception {
    Method benchmarkMethod = RuntimeBenchmark.class.getDeclaredMethod("macrobenchmark");
    Instrumentation instrumentation = instrument.createInstrumentation(benchmarkMethod);
    assertEquals(benchmarkMethod, instrumentation.benchmarkMethod());
    assertEquals(instrument, instrumentation.instrument());
    assertEquals(MacrobenchmarkWorker.class, instrumentation.workerClass());
  }
View Full Code Here


    assertEquals(MacrobenchmarkWorker.class, instrumentation.workerClass());
  }

  @Test public void createInstrumentation_microbenchmark() throws Exception {
    Method benchmarkMethod = RuntimeBenchmark.class.getDeclaredMethod("microbenchmark", int.class);
    Instrumentation instrumentation = instrument.createInstrumentation(benchmarkMethod);
    assertEquals(benchmarkMethod, instrumentation.benchmarkMethod());
    assertEquals(instrument, instrumentation.instrument());
    assertEquals(RuntimeWorker.Micro.class, instrumentation.workerClass());
  }
View Full Code Here

    assertEquals(RuntimeWorker.Micro.class, instrumentation.workerClass());
  }

  @Test public void createInstrumentation_picobenchmark() throws Exception {
    Method benchmarkMethod = RuntimeBenchmark.class.getDeclaredMethod("picobenchmark", long.class);
    Instrumentation instrumentation = instrument.createInstrumentation(benchmarkMethod);
    assertEquals(benchmarkMethod, instrumentation.benchmarkMethod());
    assertEquals(instrument, instrumentation.instrument());
    assertEquals(RuntimeWorker.Pico.class, instrumentation.workerClass());
  }
View Full Code Here

    }

    @Override
    public Instrumentation createInstrumentation(Method benchmarkMethod)
        throws InvalidBenchmarkException {
      return new Instrumentation(benchmarkMethod) {
        @Override
        public Class<? extends Worker> workerClass() {
          throw new UnsupportedOperationException();
        }
View Full Code Here

      BenchmarkSpec benchmarkSpec,
      int localPort,
      Gson gson,
      BenchmarkClass benchmarkClass) {
    // TODO(lukes): it would be nice to split this method into a few smaller more targeted methods
    Instrumentation instrumentation = experiment.instrumentation();
    Instrument instrument = instrumentation.instrument();
    ImmutableList.Builder<String> parameterClassNames = ImmutableList.builder();
    for (Class<?> parameterType : instrumentation.benchmarkMethod.getParameterTypes()) {
      parameterClassNames.add(parameterType.getName());
    }
    WorkerSpec request = new WorkerSpec(
        trialId,
        instrumentation.workerClass().getName(),
        instrumentation.workerOptions(),
        benchmarkSpec,
        parameterClassNames.build(),
        localPort);

    ProcessBuilder processBuilder = new ProcessBuilder().redirectErrorStream(false);
View Full Code Here

TOP

Related Classes of com.google.caliper.runner.Instrument.Instrumentation

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.