org.mmtk.utility.statistics
Class Stats

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

public class Stats
extends Object

This class implements basic statistics functionality


Nested Class Summary
(package private) static class Stats.Phase
           
 
Field Summary
private static Counter[] counter
           
private static int counters
           
(package private) static boolean exceededPhaseLimit
           
static boolean GATHER_MARK_CONS_STATS
           
(package private) static boolean gatheringStats
           
private static int gcCount
           
(package private) static int MAX_COUNTERS
          Maximum number of counters that can be in operation
(package private) static int MAX_PHASES
          Maximum number of gc/mutator phases that can be counted
(package private) static int phase
           
 
Constructor Summary
Stats()
           
 
Method Summary
private static void closeStatXml()
           
static void endGC()
          End a GC phase.
static boolean gatheringStats()
           
static int gcCount()
           
(package private) static void newCounter(Counter ctr)
          Add a new counter to the set of managed counters.
private static void openStatXml(String name)
           
private static void printColumnNames()
          Print out statistics column names
static void printPhases()
          Print out statistics for each mutator/gc phase
private static void printPhaseStatXml(Counter c, int p, Stats.Phase phase)
          Print a single phase counter in an xml tag
static void printPhasesXml()
          Print out statistics for each mutator/gc phase in Xml format
static void printStats()
           
static void printStatsPlain()
          Print out statistics
static void printStatsXml()
          Print command-line options and statistics in XML format
static void printTotals()
          Print out statistics totals
static void printTotalsXml()
          Print out statistics totals in Xml format
private static void printTotalXml(Counter c, Stats.Phase phase)
          Print a single total in an xml tag
static void startAll()
          Start all implicitly started counters (i.e. those for whom start == true).
static void startGC()
          Start a new GC phase.
static void stopAll()
          Stop all counters
private static void stopAllCounters()
          Stop all counters
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

GATHER_MARK_CONS_STATS

public static final boolean GATHER_MARK_CONS_STATS
See Also:
Constant Field Values

MAX_PHASES

static final int MAX_PHASES
Maximum number of gc/mutator phases that can be counted

See Also:
Constant Field Values

MAX_COUNTERS

static final int MAX_COUNTERS
Maximum number of counters that can be in operation

See Also:
Constant Field Values

counters

private static int counters

counter

private static Counter[] counter

phase

static int phase

gcCount

private static int gcCount

gatheringStats

static boolean gatheringStats

exceededPhaseLimit

static boolean exceededPhaseLimit
Constructor Detail

Stats

public Stats()
Method Detail

newCounter

static void newCounter(Counter ctr)
Add a new counter to the set of managed counters.

Parameters:
ctr - The counter to be added.

startGC

public static void startGC()
Start a new GC phase. This means notifying each counter of the phase change.


endGC

public static void endGC()
End a GC phase. This means notifying each counter of the phase change.


startAll

public static void startAll()
Start all implicitly started counters (i.e. those for whom start == true).


stopAll

public static void stopAll()
Stop all counters


stopAllCounters

private static void stopAllCounters()
Stop all counters


printStats

public static void printStats()

printStatsPlain

public static void printStatsPlain()
Print out statistics


printTotals

public static void printTotals()
Print out statistics totals


printPhases

public static void printPhases()
Print out statistics for each mutator/gc phase


printColumnNames

private static void printColumnNames()
Print out statistics column names


printStatsXml

public static void printStatsXml()
Print command-line options and statistics in XML format


openStatXml

private static void openStatXml(String name)

closeStatXml

private static void closeStatXml()

printTotalsXml

public static void printTotalsXml()
Print out statistics totals in Xml format


printTotalXml

private static void printTotalXml(Counter c,
                                  Stats.Phase phase)
Print a single total in an xml tag

Parameters:
c - The counter
phase - The phase

printPhaseStatXml

private static void printPhaseStatXml(Counter c,
                                      int p,
                                      Stats.Phase phase)
Print a single phase counter in an xml tag

Parameters:
c - The counter
p - The phase number
phase - The phase (null, "mu" or "gc")

printPhasesXml

public static void printPhasesXml()
Print out statistics for each mutator/gc phase in Xml format


gcCount

public static int gcCount()
Returns:
The GC count (inclusive of any in-progress GC)

gatheringStats

public static boolean gatheringStats()
Returns:
true if currently gathering stats