org.neuroph.util.benchmark
Class BenchmarkTask

java.lang.Object
  extended by org.neuroph.util.benchmark.BenchmarkTask
Direct Known Subclasses:
MyBenchmarkTask

public abstract class BenchmarkTask
extends Object

This class is an abstract base class for specific microbenchmarking tasks

Author:
Zoran Sevarac

Constructor Summary
BenchmarkTask(String name)
          Creates a new instance of BenchmarkTask with specified name
 
Method Summary
 String getName()
          Gets task name
 int getTestIterations()
          Gets number of test (benchmarking) iterations
 int getWarmupIterations()
          Gets number of warmup iterations.
abstract  void prepareTest()
          Any initialization before running performance test (benchmark) goes here
abstract  void runTest()
          This method should hold the code to benchmark
 void setName(String name)
          Sets task name
 void setTestIterations(int testIterations)
          Sets number of test (benchmarking) iterations
 void setWarmupIterations(int warmupIterations)
          Sets the number of warmup iterations
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BenchmarkTask

public BenchmarkTask(String name)
Creates a new instance of BenchmarkTask with specified name

Parameters:
name - benchmark task name
Method Detail

getName

public String getName()
Gets task name

Returns:
task name

setName

public void setName(String name)
Sets task name

Parameters:
name - task name

getTestIterations

public int getTestIterations()
Gets number of test (benchmarking) iterations

Returns:
number of test iterations

setTestIterations

public void setTestIterations(int testIterations)
Sets number of test (benchmarking) iterations

Parameters:
testIterations - number of test iterations

getWarmupIterations

public int getWarmupIterations()
Gets number of warmup iterations. Warmup iterations are used to run test for some time to stabilize JVM (compiling, optimizations, gc)

Returns:
number of warmup iterations

setWarmupIterations

public void setWarmupIterations(int warmupIterations)
Sets the number of warmup iterations

Parameters:
warmupIterations - number of warmup iterations Warmup iterations are used to run test for some time to stabilize JVM (compiling, optimizations, gc)

prepareTest

public abstract void prepareTest()
Any initialization before running performance test (benchmark) goes here


runTest

public abstract void runTest()
This method should hold the code to benchmark



Copyright © 2012. All Rights Reserved.