|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgate.util.profile.Profiler
Field Summary | |
private Hashtable |
m_categoryLasts
|
private Hashtable |
m_categorySums
|
private long |
m_currMemory
|
private long |
m_diffMemory
|
private boolean |
m_doPrintToStdOut
Indicates whether just to return the string dumps (false) or also print them to the std out (true) |
private boolean |
m_enabled
|
private boolean |
m_garbageCollection
|
private long |
m_lastCheckTime
|
private long |
m_lastDuration
|
private long |
m_maxMemory
|
private PrintStream |
m_out
|
private long |
m_profilerTime
|
private Runtime |
m_rt
|
private long |
m_startTime
|
Constructor Summary | |
Profiler()
|
Method Summary | |
private void |
checkCategories(String[] categs)
|
String |
checkPoint(String execPointDescr)
To be called at all execution points of interest. |
String |
checkPoint(String execPointDescr,
String[] categories,
boolean showDescr,
boolean showStats,
boolean memoryCheck)
In addition to the variant of the method with two parameters allows: a set of categories (identified by strings) to which the preceeding fragment of code belongs; flag determining whether the description of the execution point to be displayed; flag determining whether the statistics to be shown |
void |
enable(boolean isEnabled)
Switches the profiler ON and OFF. |
void |
enableGCCalling(boolean collect)
Tell's the profiler whether to call the garbage collector when detecting memory usage or not. |
long |
getCategoryTimeLast(String category)
Returns 0 if the category was not found |
long |
getCategoryTimeSum(String category)
Returns 0 if the category was not found |
long |
getNetRunTime()
Returns the time spend in the last run without the time spend by the profiler. |
long |
getProfilerTime()
Returns the time spend by the profiler during the last run. |
long |
getRunDuration()
Returns the time spend in the current run until the last check-point inclusive the time spend by the profiler. |
String |
initRun(String runDescription)
Inialises the profiler for a new run |
boolean |
isEnabled()
Answers is the profiler switched ON or OFF. |
boolean |
isGCCallingEnabled()
|
void |
printCategAvg(String categ,
long items,
double volume,
String whateverMeasure)
An auxiliary routine printing time, avg. time, and avg. speed for a category |
String |
printSpeed(long timeMillis,
double whatever,
String whateverMeasure)
An auxiliary routine printing in a string speed |
String |
printTime(long timeMillis)
An auxiliary routine printing time in "nnn.nns" format |
void |
printToSystemOut(boolean doPrint)
Sets the profiler to print (or not) to the standard output. |
void |
showCategoryTime(String categ)
Prints the time for certain category of activities |
void |
showCategoryTimes()
Prints the time for all the categories of activities |
private String |
showResults(String execPointDescr,
boolean showDescr,
boolean showStats)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private PrintStream m_out
private boolean m_enabled
private boolean m_garbageCollection
private boolean m_doPrintToStdOut
private Hashtable m_categorySums
private Hashtable m_categoryLasts
private Runtime m_rt
private long m_startTime
private long m_lastCheckTime
private long m_profilerTime
private long m_lastDuration
private long m_maxMemory
private long m_currMemory
private long m_diffMemory
Constructor Detail |
public Profiler()
Method Detail |
public void enable(boolean isEnabled)
public boolean isEnabled()
public void enableGCCalling(boolean collect)
public boolean isGCCallingEnabled()
enableGCCalling(boolean)
public long getProfilerTime()
public long getNetRunTime()
public long getRunDuration()
public String initRun(String runDescription)
public String checkPoint(String execPointDescr)
public String checkPoint(String execPointDescr, String[] categories, boolean showDescr, boolean showStats, boolean memoryCheck)
private void checkCategories(String[] categs)
private String showResults(String execPointDescr, boolean showDescr, boolean showStats)
public long getCategoryTimeSum(String category)
public long getCategoryTimeLast(String category)
public void showCategoryTimes()
public void showCategoryTime(String categ)
public String printTime(long timeMillis)
public String printSpeed(long timeMillis, double whatever, String whateverMeasure)
public void printCategAvg(String categ, long items, double volume, String whateverMeasure)
public void printToSystemOut(boolean doPrint)
doPrint
- whether or not to print to std out.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |