public class SizeCounter extends Object
The counter is trivially composed from two event counters (one for counting the number of events, the other for counting the volume).
Modifier and Type | Field and Description |
---|---|
private EventCounter |
units |
private EventCounter |
volume |
Constructor and Description |
---|
SizeCounter(String name)
Constructor
|
SizeCounter(String name,
boolean start)
Constructor
|
SizeCounter(String name,
boolean start,
boolean mergephases)
Constructor
|
Modifier and Type | Method and Description |
---|---|
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
|
private final EventCounter units
private final EventCounter volume
public SizeCounter(String name)
name
- The name to be associated with this counterpublic SizeCounter(String name, boolean start)
name
- The name to be associated with this counterstart
- True if this counter is to be implicitly started
when startAll()
is called (otherwise the counter
must be explicitly started).public SizeCounter(String name, boolean start, boolean mergephases)
name
- The name to be associated with this counterstart
- 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.public void inc(int value)
value
value
- The amount by which the counter should be incremented.public void start()
public void stop()
public void printCurrentUnits()
public void printCurrentVolume()
public void printUnits()
public void printVolume()