|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object visad.util.Trace
public class Trace
This class provides a hook into the IDV Trace facility. It uses reflection to call the corresponding ucar.unidata.util.Trace methods if that class can be found. Else, nothing happens. To use this first call: Trace.startTrace();
You can bracket a code segment with:
Trace.call1("some label"); ... code Trace.call2("some label");This matches the "some label". It will indent subsequent Trace calls to show nesting. You can also just print something out with:
Trace.msg("some message");The output looks like:
196 996 >ImageRenderer type.doTransform 11 99 >ImageRenderer build texture length: 4503200 2 15 >ImageRenderer new byte 691 15683 <ImageRenderer new byte ms: 690 1 1 >ImageRenderer color_bytes 345 99 <ImageRenderer color_bytes ms: 344 0 2 <ImageRenderer build texture ms: 1037The first column is the elapsed time since the last print line. The second column is the memory delta (note: GC can make this negative). For the call1/call2 pairs the ms:... shows the time spent in the block.
Constructor Summary | |
---|---|
Trace()
|
Method Summary | |
---|---|
static void |
call1(String msg)
Bracket a block of code with call1("some unique msg"); ...code...; call2("some unique msg"); Where "some unique msg" is used to match up the call1/call2 pairs |
static void |
call1(String msg,
String extra)
Bracket a block of code with call1("some unique msg"); ...code...; call2("some unique msg"); Append extra to the end of the line |
static void |
call2(String msg)
Bracket a block of code with call1("some unique msg"); ...code...; call2("some unique msg"); |
static void |
call2(String msg,
String extra)
Close the call |
static void |
main(String[] args)
|
static void |
msg(String msg)
Print out a line |
static void |
startTrace()
Call this to start tracing |
static void |
stopTrace()
Call this to start tracing |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Trace()
Method Detail |
---|
public static void main(String[] args)
public static void call1(String msg)
public static void call1(String msg, String extra)
public static void startTrace()
public static void stopTrace()
public static void call2(String msg)
public static void call2(String msg, String extra)
public static void msg(String msg)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |