|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectscale.common.Statistics
public class Statistics
This class registers statistics that are gathered by different classes.
$Id: Statistics.java,v 1.35 2007-08-27 18:37:51 burrill Exp $
Copyright 2008 by the
Scale Compiler Group,
Department of Computer Science
University of Massachusetts,
Amherst MA. 01003, USA
All Rights Reserved.
A statistic is a scalar value kept by class. The name of the statistic is used to invoke a static method that returns the statistic for that class.
The status level is used to determine whether or not the "created" statistics should be collected. A level of 1 causes statistics to be collected. A level of 2 collects the "created" statistic as well.
| Constructor Summary | |
|---|---|
Statistics()
|
|
| Method Summary | |
|---|---|
static void |
cleanup()
Clean up for profiling statistics. |
static java.lang.String |
formatStat(java.lang.String className,
java.lang.String stat,
int value,
java.lang.String forWhat)
Format a statistic. |
static java.lang.String |
formatStat(java.lang.String className,
java.lang.String stat,
java.lang.Object value,
java.lang.String forWhat)
Format a statistic. |
static void |
print(java.io.PrintStream out,
java.lang.String forWhat)
Print out the values of the statistic specified for each class. |
static void |
register(java.lang.String cn,
java.lang.String stat)
Register a class as keeping a statistic. |
static void |
register(java.lang.String cn,
java.lang.String[] stats)
Register a class as keeping a list of statistics. |
static void |
reportStatistics(int level,
java.lang.String file)
Print out the statistics if this status level is selected. |
static void |
reportStatus(int msg)
Print out the message is the status level is one. |
static void |
reportStatus(int msg,
int level)
Print out the message is the status level is one. |
static void |
reportStatus(int msg,
java.lang.String text)
Print out the message is the status level is one. |
static void |
reportStatus(int msg,
java.lang.String text1,
int level)
Print out the message if this status level is selected. |
static void |
reportStatus(int msg,
java.lang.String text1,
java.lang.String text2,
int level)
Print out the message if this status level is selected. |
static void |
setStatusLevel(int level,
java.lang.String tag)
Set the status level. |
static void |
snapshot(java.lang.String snName)
Take a snapshot of the statistics. |
static boolean |
status(int level)
Get the status level. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Statistics()
| Method Detail |
|---|
public static void setStatusLevel(int level,
java.lang.String tag)
level - a positive integer control the status leveltag - to specify for whom the statistic was generated
public static void reportStatistics(int level,
java.lang.String file)
level - the status level for this status
public static void reportStatus(int msg,
java.lang.String text1,
java.lang.String text2,
int level)
msg - is the status messagetext1 - is additional informationtext2 - is additional informationlevel - is the status level for this statusMsg
public static void reportStatus(int msg,
java.lang.String text1,
int level)
msg - is the status messagetext1 - is additional informationlevel - is the status level for this statusMsgpublic static void reportStatus(int msg)
msg - is the status messageMsg
public static void reportStatus(int msg,
int level)
msg - is the status messagelevel - is the status level for this statusMsg
public static void reportStatus(int msg,
java.lang.String text)
msg - is the status messagetext - is additional informationMsgpublic static boolean status(int level)
level - the status level
public static void register(java.lang.String cn,
java.lang.String[] stats)
stats - is a list of the names of the statisticscn - is the class name.
public static void register(java.lang.String cn,
java.lang.String stat)
stat - is the name of the statisticcn - is the class name.public static void snapshot(java.lang.String snName)
snName - a name to associate with this snapshot
public static java.lang.String formatStat(java.lang.String className,
java.lang.String stat,
java.lang.Object value,
java.lang.String forWhat)
className - is the name of the class reporting the statisticstat - is the name of the statisticvalue - is the value of the statisticforWhat - is the tag
public static java.lang.String formatStat(java.lang.String className,
java.lang.String stat,
int value,
java.lang.String forWhat)
className - is the name of the class reporting the statisticstat - is the name of the statisticvalue - is the value of the statisticforWhat - is the tag
public static void print(java.io.PrintStream out,
java.lang.String forWhat)
out - is the PrintStream for the outputforWhat - is a string that is prepended to the statistics
printedpublic static void cleanup()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||