public final class BenchmarkMethod extends Object
BeforeBenchClass
, BeforeFirstRun
, BeforeEachRun
,
AfterEachRun
, AfterLastRun
and AfterBenchClass
annotated related methods.AfterBenchClass
,
AfterLastRun
,
AfterEachRun
,
BeforeEachRun
,
BeforeFirstRun
,
BeforeBenchClass
Constructor and Description |
---|
BenchmarkMethod(Method paramMethod)
Constructor, with a definite method to bench.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
Method[] |
findAfterEachRun()
Method to find a
AfterEachRun annotation. |
Method[] |
findAfterLastRun()
Method to find a
AfterLastRun annotation. |
static Method |
findAndCheckAnyMethodByAnnotation(Class<?> clazz,
Class<? extends Annotation> anno)
This class finds any method with a given annotation.
|
Method[] |
findBeforeEachRun()
Method to find a
BeforeEachRun annotation. |
Method[] |
findBeforeFirstRun()
Method to find a
BeforeFirstRun annotation. |
Method |
getMethodToBench()
Simple getter for encapsulated method.
|
String |
getMethodWithClassName()
This method returns the fully qualified name consisting of its own name
and its class name
|
static int |
getNumberOfAnnotatedRuns(Method meth)
Getting the number of runs corresponding to a given method.
|
int |
hashCode() |
static boolean |
isBenchmarkable(Method meth)
This method should act as a check to guarantee that only specific
Benchmarkables are used for benching.
|
static boolean |
isReflectedExecutable(Method meth,
Class<? extends Annotation> anno)
Checks if this method is executable via reflection for perfidix purposes.
|
String |
toString() |
public BenchmarkMethod(Method paramMethod)
isBenchmarkable(Method)
first,
otherwise an IllegalArgumentException could arise.paramMethod
- method to be benched (eventually)public Method[] findBeforeFirstRun() throws PerfidixMethodCheckException
BeforeFirstRun
annotation. This method should be
invoked for all methods. The corresponding class is searched after
suitable methods and checks for integrity are made. If there are multiple BeforeFirstRun
-annotated methods available, an exception is
thrown. If there are designated special BeforeFirstRun
methods as
given in the parameter of the Bench
-annotation, this method is
taken with any further checking of the other methods in the class.PerfidixMethodCheckException
- if integrity check of class and method fails.BeforeFirstRun
,
Bench
public Method[] findBeforeEachRun() throws PerfidixMethodCheckException
BeforeEachRun
annotation. This method should be
invoked for all methods. The corresponding class is searched after
suitable methods and checks for integrity are made. If there are multiple BeforeEachRun
-annotated methods available, an exception is
thrown. If there are designated special BeforeEachRun
methods as
given in the parameter of the Bench
-annotation, this method is
taken with any further checking of the other methods in the class.PerfidixMethodCheckException
- if integrity check of class and method fails.BeforeEachRun
,
Bench
public Method[] findAfterEachRun() throws PerfidixMethodCheckException
AfterEachRun
annotation. This method should be
invoked for all methods. The corresponding class is searched after
suitable methods and checks for integrity are made. If there are multiple AfterEachRun
-annotated methods available, an exception is
thrown. If there are designated special AfterEachRun
methods as
given in the parameter of the Bench
-annotation, this method is
taken with any further checking of the other methods in the class.PerfidixMethodCheckException
- if integrity check of class and method fails.AfterEachRun
,
Bench
public Method[] findAfterLastRun() throws PerfidixMethodCheckException
AfterLastRun
annotation. This method should be
invoked for all methods. The corresponding class is searched after
suitable methods and checks for integrity are made. If there are multiple AfterLastRun
-annotated methods available, an exception is
thrown. If there are designated special AfterLastRun
methods as
given in the parameter of the Bench
-annotation, this method is
taken with any further checking of the other methods in the class.PerfidixMethodCheckException
- if integrity check of class and method fails.AfterLastRun
,
Bench
public Method getMethodToBench()
public static int getNumberOfAnnotatedRuns(Method meth)
meth
- to be checkedpublic static Method findAndCheckAnyMethodByAnnotation(Class<?> clazz, Class<? extends Annotation> anno) throws PerfidixMethodCheckException
anno
- of the method to be foundclazz
- class to be searchedPerfidixMethodCheckException
- if these integrity checks failpublic static boolean isBenchmarkable(Method meth)
meth
- method to be checked.public static boolean isReflectedExecutable(Method meth, Class<? extends Annotation> anno)
meth
- method to be checkedanno
- anno for method to be check, necessary since different
attributes are possible depending on the annoCopyright © 2013 University of Konstanz, Distributed Systems Group. All Rights Reserved.