com.google.caliper.runner
Class Instrument

java.lang.Object
  extended by com.google.caliper.runner.Instrument
Direct Known Subclasses:
AllocationCountInstrument, AllocationSizeInstrument, ArbitraryMeasurementInstrument, MicrobenchmarkInstrument

public abstract class Instrument
extends Object


Constructor Summary
Instrument()
           
 
Method Summary
abstract  BenchmarkMethod createBenchmarkMethod(BenchmarkClass benchmarkClass, Method method)
           
static BenchmarkMethod createBenchmarkMethodFromTimeMethod(BenchmarkClass benchmarkClass, Method timeMethod)
          For instruments that use isTimeMethod(java.lang.reflect.Method) to identify their methods, this method builds a BenchmarkMethod appropriately.
abstract  void dryRun(Benchmark benchmark, BenchmarkMethod method)
           
 ShortDuration estimateRuntimePerTrial()
           
abstract  boolean isBenchmarkMethod(Method method)
           
static boolean isTimeMethod(Method method)
          Several instruments look for benchmark methods like timeBlah(int reps); this is the centralized code that identifies such methods.
abstract  Class<? extends Worker> workerClass()
           
 Map<String,String> workerOptions()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Instrument

public Instrument()
Method Detail

estimateRuntimePerTrial

public ShortDuration estimateRuntimePerTrial()

isBenchmarkMethod

public abstract boolean isBenchmarkMethod(Method method)

createBenchmarkMethod

public abstract BenchmarkMethod createBenchmarkMethod(BenchmarkClass benchmarkClass,
                                                      Method method)
                                               throws InvalidBenchmarkException
Throws:
InvalidBenchmarkException

dryRun

public abstract void dryRun(Benchmark benchmark,
                            BenchmarkMethod method)
                     throws UserCodeException
Throws:
UserCodeException

workerOptions

public Map<String,String> workerOptions()

workerClass

public abstract Class<? extends Worker> workerClass()

isTimeMethod

public static boolean isTimeMethod(Method method)
Several instruments look for benchmark methods like timeBlah(int reps); this is the centralized code that identifies such methods.


createBenchmarkMethodFromTimeMethod

public static BenchmarkMethod createBenchmarkMethodFromTimeMethod(BenchmarkClass benchmarkClass,
                                                                  Method timeMethod)
                                                           throws InvalidBenchmarkException
For instruments that use isTimeMethod(java.lang.reflect.Method) to identify their methods, this method builds a BenchmarkMethod appropriately.

Throws:
InvalidBenchmarkException


Copyright © 2009-2011 Google, Inc.. All Rights Reserved.