public abstract class Counter extends Object
Modifier and Type | Field and Description |
---|---|
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 and Description |
---|
Counter(String name)
Constructor
|
Counter(String name,
boolean start)
Constructor
|
Counter(String name,
boolean start,
boolean mergephases)
Constructor
|
Modifier and Type | Method and Description |
---|---|
(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
|
private final boolean start
private final boolean mergephases
protected boolean complex
Counter(String name)
name
- The name to be associated with this counterCounter(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).Counter(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.abstract void start()
abstract void stop()
abstract void phaseChange(int oldPhase)
oldPhase
- The last phaseabstract void printCount(int phase)
phase
- The phase to be printedabstract void printTotal()
abstract void printTotal(boolean mutator)
mutator
- true
if the total for the mutator phases is to be
printed (otherwise the total for the GC phases will be printed).abstract void printMin(boolean mutator)
mutator
- true
if the minimum for the mutator phase is to be
printed (otherwise the minimum for the GC phase will be printed).abstract void printMax(boolean mutator)
mutator
- true
if the maximum for the mutator phase is to be
printed (otherwise the maximum for the GC phase will be printed).public void printLast()
String getColumnSuffix()
boolean getStart()
true
if this counter is implicitly started when
startAll()
is called.true
if this counter is implicitly started when
startAll()
is called.boolean mergePhases()
boolean isComplex()