package com.carrotsearch.junitbenchmarks;
import java.lang.annotation.*;
/**
* Benchmark options applicable to methods annotated as tests.
*/
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.TYPE, ElementType.METHOD})
public @interface BenchmarkOptions
{
/**
* @return Call {@link System#gc()} before each test. This may slow down the tests
* in a significant way, so disabling it is sensible in most cases.
*/
boolean callgc() default false;
/**
* Sets the number of warmup rounds for the test. If negative, the default is taken
* from global options.
*/
int warmupRounds() default -1;
/**
* Sets the number of benchmark rounds for the test. If negative, the default is taken
* from global options.
*/
int benchmarkRounds() default -1;
/**
* Define the factor by which the performance can degrade compared to the last run.
* If negative, the default value is taken from global options. If that
* does not exist, this performance assertion is turned off.
*/
double perfDiffToLastRun() default -1;
/**
* Define the factor by which the performance can degrade compared to the average
* over the last {@link #perfAverageOverRuns()} runs.
* If negative, the default value is taken from global options. If that
* does not exist, this performance assertion is turned off.
*/
double perfDiffToAverage() default -1;
/**
* Compute the average performance over this much runs.
* If negative, the default value is taken from global options. If that
* does not exist, this performance assertion is turned off.
*/
int perfAverageOverRuns() default 20;
/**
* Ignore runs before or equal to this in performance assertion.
* If <= 0, the default value is taken from global options.
*/
int perfIgnoreUpToRun() default 0;
/**
* This value will be used to calculate the number of units / sec.
* Unused if <= 0.
*/
long perfUnits() default 0;
}