com.google.caliper.runner
Class Instrument
java.lang.Object
com.google.caliper.runner.Instrument
- Direct Known Subclasses:
- AllocationCountInstrument, AllocationSizeInstrument, ArbitraryMeasurementInstrument, MicrobenchmarkInstrument
public abstract class Instrument
- extends Object
Instrument
public Instrument()
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.