visad.util
Class Trace
- java.lang.Object
-
- visad.util.Trace
-
public class Trace extends java.lang.ObjectThis 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: 1037
The 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
Constructors Constructor and Description Trace()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method and Description static voidcall1(java.lang.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 pairsstatic voidcall1(java.lang.String msg, java.lang.String extra)Bracket a block of code with call1("some unique msg"); ...code...; call2("some unique msg"); Append extra to the end of the linestatic voidcall2(java.lang.String msg)Bracket a block of code with call1("some unique msg"); ...code...; call2("some unique msg");static voidcall2(java.lang.String msg, java.lang.String extra)Close the callstatic voidmain(java.lang.String[] args)static voidmsg(java.lang.String msg)Print out a linestatic voidstartTrace()Call this to start tracingstatic voidstopTrace()Call this to start tracing
-
-
-
Method Detail
-
main
public static void main(java.lang.String[] args)
-
call1
public static void call1(java.lang.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
-
call1
public static void call1(java.lang.String msg, java.lang.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
-
startTrace
public static void startTrace()
Call this to start tracing
-
stopTrace
public static void stopTrace()
Call this to start tracing
-
call2
public static void call2(java.lang.String msg)
Bracket a block of code with call1("some unique msg"); ...code...; call2("some unique msg");
-
call2
public static void call2(java.lang.String msg, java.lang.String extra)Close the call
-
msg
public static void msg(java.lang.String msg)
Print out a line
-
-
DMelt 3.0 © DataMelt by jWork.ORG