de.uka.ipd.sdq.ByCounter.example
Class ByCounterExample

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

public class ByCounterExample
extends java.lang.Object

This example class demonstrates the usage of ByCounter in different scenarios. This includes usage of the options, description of the methods to instrument and aggregation of results. This class should be studied as source code.

See the ByCounter documentation for a more thorough exploration of these examples.

Since:
0.1
Version:
0.9
Author:
Martin Krogmann, Michael Kuperberg

Constructor Summary
ByCounterExample(int number)
          Examplary constructor with one argument.
 
Method Summary
static int dummyMethodToBeInstrumented(java.lang.String str, float f)
          This dummy method is here to get instrumented in the example.
static void example1()
          Quickstart example of the most basic ByCounter usage.
static void example2()
          Example of ByCounter usage with options.
static void main(java.lang.String[] args)
          The application entry point.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ByCounterExample

public ByCounterExample(int number)
Examplary constructor with one argument.

Parameters:
number - An unimportant number. See explanations for example1() of how non-"standard" constructors must be treated in instrumentation, which is mandatory when no default constructor is available because a parameterless default constructor is NOT declared while a non-default one (with params) is.
Method Detail

dummyMethodToBeInstrumented

public static int dummyMethodToBeInstrumented(java.lang.String str,
                                              float f)
This dummy method is here to get instrumented in the example.

Parameters:
str - Some String that gets printed.
f - Some float that contributes to the result.
Returns:
An int value that is computed based on input (cf. source code).

example1

public static void example1()
Quickstart example of the most basic ByCounter usage.


example2

public static void example2()
Example of ByCounter usage with options. Watch the console output to see where the result log file is written.


main

public static void main(java.lang.String[] args)
The application entry point.

Parameters:
args - No arguments are needed or evaluated.