Class AllocationInstrument
- java.lang.Object
-
- com.google.caliper.runner.instrument.Instrument
-
- com.google.caliper.runner.instrument.AllocationInstrument
-
@SupportsVmType(JVM) public final class AllocationInstrument extends Instrument
Instrument
that watches the memory allocations in an invocation of the benchmark method and reports some statistic. The benchmark method must accept a single int argument 'reps', which is the number of times to execute the guts of the benchmark method, and it must be public and non-static.Note that the allocation instruments reports a "worst case" for allocation in that it reports the bytes and objects allocated in interpreted mode (no JIT).
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.google.caliper.runner.instrument.Instrument
Instrument.InstrumentedMethod
-
-
Constructor Summary
Constructors Constructor Description AllocationInstrument()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Instrument.InstrumentedMethod
createInstrumentedMethod(BenchmarkClassModel.MethodModel benchmarkMethod)
com.google.common.collect.ImmutableSet<String>
getExtraCommandLineArgs(VmConfig vmConfig)
This instrument's worker requires the allocationinstrumenter agent jar, specified on the worker VM's command line with "-javaagent:[jarfile]".com.google.common.collect.ImmutableSet<String>
instrumentOptions()
boolean
isBenchmarkMethod(BenchmarkClassModel.MethodModel method)
boolean
parallelizable()
-
Methods inherited from class com.google.caliper.runner.instrument.Instrument
getSpec, name, options, setOptions, toString
-
-
-
-
Method Detail
-
isBenchmarkMethod
public boolean isBenchmarkMethod(BenchmarkClassModel.MethodModel method)
- Specified by:
isBenchmarkMethod
in classInstrument
-
createInstrumentedMethod
public Instrument.InstrumentedMethod createInstrumentedMethod(BenchmarkClassModel.MethodModel benchmarkMethod) throws InvalidBenchmarkException
- Specified by:
createInstrumentedMethod
in classInstrument
- Throws:
InvalidBenchmarkException
-
parallelizable
public boolean parallelizable()
- Overrides:
parallelizable
in classInstrument
-
instrumentOptions
public com.google.common.collect.ImmutableSet<String> instrumentOptions()
-
getExtraCommandLineArgs
public com.google.common.collect.ImmutableSet<String> getExtraCommandLineArgs(VmConfig vmConfig)
This instrument's worker requires the allocationinstrumenter agent jar, specified on the worker VM's command line with "-javaagent:[jarfile]".- Overrides:
getExtraCommandLineArgs
in classInstrument
-
-