org.mbari.siam.operations.portal
Class Profiler

java.lang.Object
  extended by org.mbari.siam.operations.portal.Profiler

public class Profiler
extends java.lang.Object

Help profile java apps by printing formatted messages to log4j. Profiler is NOT intented to be a hard real time profiling tool. It is intended to be used as a general debugging tool enabling users to - get an idea for how much time is being spent on a code block (~ 1 msec resolution) - mark related sets of debug statements so that they may be easily separated from other program output - produce structured debug statements that may be easily loaded into statistical tools like Excel and Matlab for analysis


Field Summary
 boolean _enabled
           
static java.lang.String _end
           
static java.lang.String _info
           
static java.lang.String _start
           
static int DEVICENOTFOUND_EXCEPTION
           
static java.lang.Integer END
           
static int EXCEPTION
           
static java.lang.Integer INFO
           
static int IO_EXCEPTION
           
static int LEASEREFUSED_EXCEPTION
           
static long NO_ID
           
static int NO_STATUS
           
static int NODATA_EXCEPTION
           
static int OK
           
static int REMOTE_EXCEPTION
           
static java.lang.Integer START
           
static int TIMEOUT_EXCEPTION
           
static java.lang.Integer UNDEFINED
           
static int UNKNOWNHOST_EXCEPTION
           
 
Constructor Summary
Profiler()
           
Profiler(org.apache.log4j.Logger logger)
           
Profiler(org.apache.log4j.Logger logger, java.lang.String prefix, java.lang.String delimiter)
           
Profiler(java.lang.String prefix, java.lang.String delimiter)
           
 
Method Summary
 void end(java.lang.String name, int status, long deviceID, java.lang.String msg)
           
 void error(java.lang.String msg)
           
static void excludeAppender(java.lang.String appender, java.lang.String matchString)
           
static void excludeExternal(java.lang.String appender, java.lang.String matchString)
           
 void info(java.lang.String msg)
           
 void info(java.lang.String name, int status, long deviceID, java.lang.String msg)
           
 boolean isEnabled()
           
static void main(java.lang.String[] args)
           
 void out(java.lang.String msg)
           
 void setDelimiter(java.lang.String delimiter)
           
 void setEnabled(boolean value)
           
 void setLogger(org.apache.log4j.Logger logger)
           
 void setPrefix(java.lang.String prefix)
           
 void start(java.lang.String name, int status, long deviceID, java.lang.String msg)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_enabled

public boolean _enabled

END

public static java.lang.Integer END

START

public static java.lang.Integer START

UNDEFINED

public static java.lang.Integer UNDEFINED

INFO

public static java.lang.Integer INFO

_start

public static java.lang.String _start

_end

public static java.lang.String _end

_info

public static java.lang.String _info

NO_ID

public static final long NO_ID
See Also:
Constant Field Values

NO_STATUS

public static final int NO_STATUS
See Also:
Constant Field Values

OK

public static final int OK
See Also:
Constant Field Values

EXCEPTION

public static final int EXCEPTION
See Also:
Constant Field Values

TIMEOUT_EXCEPTION

public static final int TIMEOUT_EXCEPTION
See Also:
Constant Field Values

LEASEREFUSED_EXCEPTION

public static final int LEASEREFUSED_EXCEPTION
See Also:
Constant Field Values

DEVICENOTFOUND_EXCEPTION

public static final int DEVICENOTFOUND_EXCEPTION
See Also:
Constant Field Values

REMOTE_EXCEPTION

public static final int REMOTE_EXCEPTION
See Also:
Constant Field Values

NODATA_EXCEPTION

public static final int NODATA_EXCEPTION
See Also:
Constant Field Values

IO_EXCEPTION

public static final int IO_EXCEPTION
See Also:
Constant Field Values

UNKNOWNHOST_EXCEPTION

public static final int UNKNOWNHOST_EXCEPTION
See Also:
Constant Field Values
Constructor Detail

Profiler

public Profiler()

Profiler

public Profiler(org.apache.log4j.Logger logger)

Profiler

public Profiler(java.lang.String prefix,
                java.lang.String delimiter)

Profiler

public Profiler(org.apache.log4j.Logger logger,
                java.lang.String prefix,
                java.lang.String delimiter)
Method Detail

setLogger

public void setLogger(org.apache.log4j.Logger logger)

excludeAppender

public static void excludeAppender(java.lang.String appender,
                                   java.lang.String matchString)

excludeExternal

public static void excludeExternal(java.lang.String appender,
                                   java.lang.String matchString)

setPrefix

public void setPrefix(java.lang.String prefix)

setDelimiter

public void setDelimiter(java.lang.String delimiter)

out

public void out(java.lang.String msg)

info

public void info(java.lang.String msg)

error

public void error(java.lang.String msg)

info

public void info(java.lang.String name,
                 int status,
                 long deviceID,
                 java.lang.String msg)

start

public void start(java.lang.String name,
                  int status,
                  long deviceID,
                  java.lang.String msg)

end

public void end(java.lang.String name,
                int status,
                long deviceID,
                java.lang.String msg)

setEnabled

public void setEnabled(boolean value)

isEnabled

public boolean isEnabled()

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Throws:
java.lang.Exception


Copyright © 2003 MBARI.

The Monterey Bay Aquarium Research Institute (MBARI) provides this documentation and code "as is", with no warranty, express or implied, of its quality or consistency. It is provided without support and without obligation on the part of MBARI to assist in its use, correction, modification, or enhancement.