public class Profiler extends Object
Modifier and Type | Field and Description |
---|---|
protected static org.slf4j.Logger |
log |
Constructor and Description |
---|
Profiler() |
Modifier and Type | Method and Description |
---|---|
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 |
getLastDuration() |
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.
|
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
|
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 long getLastDuration()
public String checkPoint(String execPointDescr)
public String checkPoint(String execPointDescr, String[] categories, boolean showDescr, boolean showStats, boolean memoryCheck)
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.Copyright © 2024 GATE. All rights reserved.