org.mmtk.utility.statistics
Class SizeCounter

java.lang.Object
  extended by org.mmtk.utility.statistics.SizeCounter

public class SizeCounter
extends Object

This class implements a simple counter of events of different sizes (eg object allocations, where total number of objects and total volume of objects would be counted).

The counter is trivially composed from two event counters (one for counting the number of events, the other for counting the volume).


Field Summary
private  EventCounter units
           
private  EventCounter volume
           
 
Constructor Summary
SizeCounter(String name)
          Constructor
SizeCounter(String name, boolean start)
          Constructor
SizeCounter(String name, boolean start, boolean mergephases)
          Constructor
 
Method Summary
 void inc(int value)
          Increment the event counter by value
 void printCurrentUnits()
          Print current (mid-phase) units
 void printCurrentVolume()
          Print (mid-phase) volume
 void printUnits()
          Print units
 void printVolume()
          Print volume
 void start()
          Start this counter
 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

units

private EventCounter units

volume

private EventCounter volume
Constructor Detail

SizeCounter

public SizeCounter(String name)
Constructor

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

SizeCounter

public SizeCounter(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).

SizeCounter

public SizeCounter(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

inc

public void inc(int value)
Increment the event counter by value

Parameters:
value - The amount by which the counter should be incremented.

start

public void start()
Start this counter


stop

public void stop()
Stop this counter


printCurrentUnits

public void printCurrentUnits()
Print current (mid-phase) units


printCurrentVolume

public void printCurrentVolume()
Print (mid-phase) volume


printUnits

public void printUnits()
Print units


printVolume

public void printVolume()
Print volume