org.mmtk.utility.statistics
Class Counter

java.lang.Object
  extended by org.mmtk.utility.statistics.Counter
Direct Known Subclasses:
BooleanCounter, EventCounter, LongCounter

public abstract class Counter
extends Object

This abstract class describes the interface of a generic counter.


Field Summary
protected  boolean complex
          Allow for counters whose values are too complex to be simply printed out.
private  boolean mergephases
           
private  String name
           
private  boolean start
           
 
Constructor Summary
Counter(String name)
          Constructor
Counter(String name, boolean start)
          Constructor
Counter(String name, boolean start, boolean mergephases)
          Constructor
 
Method Summary
(package private)  String getColumnSuffix()
          Return the (option) suffix to be used when reporting this counter
(package private)  String getName()
          Return the name of this counter
(package private)  boolean getStart()
          Return true if this counter is implicitly started when startAll() is called.
(package private)  boolean isComplex()
           
(package private)  boolean mergePhases()
          Return true if this counter will merge stats for GC and mutator phases.
(package private) abstract  void phaseChange(int oldPhase)
          The phase has changed (from GC to mutator or mutator to GC).
(package private) abstract  void printCount(int phase)
          Print the value of this counter for the given phase
 void printLast()
          Print statistics for the most recent phase
(package private) abstract  void printMax(boolean mutator)
          Print the current maximum value for either the mutator or GC phase
(package private) abstract  void printMin(boolean mutator)
          Print the current minimum value for either the mutator or GC phase
(package private) abstract  void printTotal()
          Print the current total for this counter
(package private) abstract  void printTotal(boolean mutator)
          Print the current total for either the mutator or GC phase
(package private) abstract  void start()
          Start this counter
(package private) abstract  void stop()
          Stop this counter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

name

private final String name

start

private final boolean start

mergephases

private final boolean mergephases

complex

protected boolean complex
Allow for counters whose values are too complex to be simply printed out.

Constructor Detail

Counter

Counter(String name)
Constructor

Parameters:
name - The name to be associated with this counter

Counter

Counter(String name,
        boolean start)
Constructor

Parameters:
name - The name to be associated with this counter
start - True if this counter is to be implicitly started when startAll() is called (otherwise the counter must be explicitly started).

Counter

Counter(String name,
        boolean start,
        boolean mergephases)
Constructor

Parameters:
name - The name to be associated with this counter
start - True if this counter is to be implicitly started when startAll() is called (otherwise the counter must be explicitly started).
mergephases - True if this counter does not separately report GC and Mutator phases.
Method Detail

start

abstract void start()
Start this counter


stop

abstract void stop()
Stop this counter


phaseChange

abstract void phaseChange(int oldPhase)
The phase has changed (from GC to mutator or mutator to GC). Take action with respect to the last phase if necessary.

Parameters:
oldPhase - The last phase

printCount

abstract void printCount(int phase)
Print the value of this counter for the given phase

Parameters:
phase - The phase to be printed

printTotal

abstract void printTotal()
Print the current total for this counter


printTotal

abstract void printTotal(boolean mutator)
Print the current total for either the mutator or GC phase

Parameters:
mutator - true if the total for the mutator phases is to be printed (otherwise the total for the GC phases will be printed).

printMin

abstract void printMin(boolean mutator)
Print the current minimum value for either the mutator or GC phase

Parameters:
mutator - true if the minimum for the mutator phase is to be printed (otherwise the minimum for the GC phase will be printed).

printMax

abstract void printMax(boolean mutator)
Print the current maximum value for either the mutator or GC phase

Parameters:
mutator - true if the maximum for the mutator phase is to be printed (otherwise the maximum for the GC phase will be printed).

printLast

public void printLast()
Print statistics for the most recent phase


getName

String getName()
Return the name of this counter

Returns:
The name of this counter

getColumnSuffix

String getColumnSuffix()
Return the (option) suffix to be used when reporting this counter

Returns:
The suffix

getStart

boolean getStart()
Return true if this counter is implicitly started when startAll() is called.

Returns:
true if this counter is implicitly started when startAll() is called.

mergePhases

boolean mergePhases()
Return true if this counter will merge stats for GC and mutator phases.

Returns:
True if this counter will merge stats for GC and mutator phases.

isComplex

boolean isComplex()