de.uka.ipd.sdq.ByCounter.example.fibonacci
Class RunExample

java.lang.Object
  extended by de.uka.ipd.sdq.ByCounter.example.fibonacci.RunExample

public class RunExample
extends java.lang.Object

Runs ByCounter on the Fibonacci algorithm and stores the counting results. This example shows how to use ByCounter to instrument a specific method and execute it not by itself, but in its regular context, i.e. as in the method countFibonacciOneIteration().

Author:
groenda

Field Summary
static java.util.logging.Logger logger
          Logger of this class.
 
Constructor Summary
RunExample()
           
 
Method Summary
static void countFibonacciOneIteration()
          Testcase for which the Bytecode instructions should be counted.
static void main(java.lang.String[] args)
          Wrapper to start the Bytecode counting.
 void measureBytecodeInstructionsInstanceMethod(long rounds)
          Measures the issued Bytecode instructions for the FibonacciAlgorithm class under test.
 void measureBytecodeInstructionsInstanceMethodContent(long rounds)
          Measures the issued Bytecode instructions for the FibonacciAlgorithm class under test.
 void measureBytecodeInstructionsStaticMethod()
          Measures the issued Bytecode instructions for the FibonacciAlgorithm class under test.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

public static java.util.logging.Logger logger
Logger of this class.

Constructor Detail

RunExample

public RunExample()
Method Detail

measureBytecodeInstructionsStaticMethod

public void measureBytecodeInstructionsStaticMethod()
Measures the issued Bytecode instructions for the FibonacciAlgorithm class under test. A static method is used for the test.


measureBytecodeInstructionsInstanceMethod

public void measureBytecodeInstructionsInstanceMethod(long rounds)
Measures the issued Bytecode instructions for the FibonacciAlgorithm class under test. A class instance's method is used for the test.

Parameters:
rounds - Execution parameter of algorithm under test.

measureBytecodeInstructionsInstanceMethodContent

public void measureBytecodeInstructionsInstanceMethodContent(long rounds)
Measures the issued Bytecode instructions for the FibonacciAlgorithm class under test. A class instance's method is used for the test. Just the content and not the method itself is measured.

Parameters:
rounds - Execution parameter of algorithm under test.

countFibonacciOneIteration

public static void countFibonacciOneIteration()
Testcase for which the Bytecode instructions should be counted. Allows to initialize the class(es) under test. Method is static to allow ByCounter execution without initializing an instance of the RunExample class.


main

public static void main(java.lang.String[] args)
Wrapper to start the Bytecode counting.

Parameters:
args - Not used.