Package com.google.caliper.core
Class BenchmarkClassModel
- java.lang.Object
-
- com.google.caliper.core.BenchmarkClassModel
-
- All Implemented Interfaces:
Serializable
public abstract class BenchmarkClassModel extends Object implements Serializable
A simplified model of a benchmark class, containing no reflective references to the class and only those things that the runner needs to know about the class in order to determine the scenarios to be run.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classBenchmarkClassModel.BuilderBuilder forBenchmarkClassModelinstances.static classBenchmarkClassModel.MethodModelModel of a method on a benchmark class.
-
Constructor Summary
Constructors Constructor Description BenchmarkClassModel()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static BenchmarkClassModelcreate(Class<?> clazz)Creates a model of the given benchmark class and does some validation of it and the given user-provided values for the class' parameter fields.com.google.common.collect.ImmutableSetMultimap<String,String>fillInDefaultParameterValues(com.google.common.collect.ImmutableSetMultimap<String,String> userParameters)Returns a multimap containing the full set of parameter values to use for the benchmark.abstract com.google.common.collect.ImmutableSet<BenchmarkClassModel.MethodModel>methods()Returns the set of all methods declared on the class.abstract Stringname()Returns the fully qualified name of the benchmark class.abstract StringsimpleName()Returns the simple name of the benchmark class.StringtoString()static voidvalidateUserParameters(Class<?> clazz, com.google.common.collect.SetMultimap<String,String> userParameters)Validates the given user-provided parameters against the parameter fields on the benchmark class.abstract com.google.common.collect.ImmutableSet<String>vmOptions()Returns the set of VM options specified with the@VmOptionsannotation.
-
-
-
Method Detail
-
create
public static BenchmarkClassModel create(Class<?> clazz)
Creates a model of the given benchmark class and does some validation of it and the given user-provided values for the class' parameter fields.
-
validateUserParameters
public static void validateUserParameters(Class<?> clazz, com.google.common.collect.SetMultimap<String,String> userParameters)
Validates the given user-provided parameters against the parameter fields on the benchmark class.
-
name
public abstract String name()
Returns the fully qualified name of the benchmark class.
-
simpleName
public abstract String simpleName()
Returns the simple name of the benchmark class.
-
methods
public abstract com.google.common.collect.ImmutableSet<BenchmarkClassModel.MethodModel> methods()
Returns the set of all methods declared on the class.
-
fillInDefaultParameterValues
public final com.google.common.collect.ImmutableSetMultimap<String,String> fillInDefaultParameterValues(com.google.common.collect.ImmutableSetMultimap<String,String> userParameters)
Returns a multimap containing the full set of parameter values to use for the benchmark. For parameters on the benchmark that have values in the given user-supplied parameters, the user's specified values are used. For all other parameters, the default values specified in the annotation or implied by the type are used.- Throws:
IllegalArgumentException- if a parameter for the benchmark has neither user-specified values nor default values
-
vmOptions
public abstract com.google.common.collect.ImmutableSet<String> vmOptions()
Returns the set of VM options specified with the@VmOptionsannotation.
-
-