|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ccs.utils.Profiler
public class Profiler
A Profiler provides basic support for profiling an application - seeing how long various bits of a process take to perform. It's no substitute for a full profiling architecture, and you do need to take it out before deploying the app (it slows things down a bit), but it can be useful where a process is severely underperforming. NB. No I18N.
MT-UNSAFE. Objects must be confined to the same thread. In a MT app, the vagiaries of thread scheduling may foul up your results - the profiler doesn't stop its clock when the thread is timesliced out.
Constructor Summary | |
---|---|
Profiler()
Construct a new Profiler. |
Method Summary | |
---|---|
void |
mark(java.lang.String marker)
Add a "waypoint". |
void |
report()
Report the profile to System.out with a default prefix. |
void |
report(java.io.PrintStream ps,
java.lang.String prefix)
Report the profile to the supplied PrintStream (typically System.out). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Profiler()
Method Detail |
---|
public void mark(java.lang.String marker)
marker
- The name of the waypoint, for reporting purposes. If null,
a waypoint will be marked as normal, but will come out as a
blank line on the final report.public void report()
public void report(java.io.PrintStream ps, java.lang.String prefix)
ps
- The PrintStream to report to.prefix
- The string to prefix every line of the report with.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |