org.eclipse.osgi.internal.profile
Class Profile

java.lang.Object
  extended by org.eclipse.osgi.internal.profile.Profile

public class Profile
extends Object

This class is a development tool that provides a simple way to log programmer defined timmings for performance evaluations. This profiling allows logging of a timestamp with a corresponding message to a trace buffer.


Field Summary
static boolean BENCHMARK
          The logging state of BENCHMARK messages
static boolean DEBUG
          The logging state of DEBUG messages
static String ENTER_DESCRIPTION
          The description for method enter
static String EXIT_DESCRIPTION
          The description for method exit
static int FLAG_ENTER
          The logging flag for method enter
static int FLAG_EXIT
          The logging flag for method exit
static int FLAG_NONE
          The default logging flag.
static boolean PROFILE
          Profiling is enabled and available.
static boolean STARTUP
          The logging state of STARTUP messages
 
Constructor Summary
Profile()
           
 
Method Summary
static void accumLogEnter(String scope)
          Use cumulative logging to record the entrance from this scope.
static void accumLogExit(String scope)
          Use cumulative logging to record the exit from this scope.
static String getProfileLog()
          Get the profiling log report and reset the trace buffer.
static void initProps()
          Initialize/update profiling properties.
static void logEnter(String id)
          Log a method enter.
static void logEnter(String id, String description)
          Log a method enter.
static void logExit(String id)
          Log a method exit.
static void logExit(String id, String description)
          Log a method exit.
static void logTime(int flag, String id, String msg, String description)
          Log a message.
static void logTime(String id, String msg)
          Log a message.
static void logTime(String id, String msg, String description)
          Log a message.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROFILE

public static final boolean PROFILE
Profiling is enabled and available.

See Also:
Constant Field Values

STARTUP

public static boolean STARTUP
The logging state of STARTUP messages


BENCHMARK

public static boolean BENCHMARK
The logging state of BENCHMARK messages


DEBUG

public static boolean DEBUG
The logging state of DEBUG messages


FLAG_NONE

public static final int FLAG_NONE
The default logging flag.

See Also:
Constant Field Values

FLAG_ENTER

public static final int FLAG_ENTER
The logging flag for method enter

See Also:
Constant Field Values

FLAG_EXIT

public static final int FLAG_EXIT
The logging flag for method exit

See Also:
Constant Field Values

ENTER_DESCRIPTION

public static final String ENTER_DESCRIPTION
The description for method enter

See Also:
Constant Field Values

EXIT_DESCRIPTION

public static final String EXIT_DESCRIPTION
The description for method exit

See Also:
Constant Field Values
Constructor Detail

Profile

public Profile()
Method Detail

initProps

public static void initProps()
Initialize/update profiling properties. If profiling properties are updated, this method is called to update the profile states.


logEnter

public static void logEnter(String id)
Log a method enter.

Parameters:
id - The method's unique identification (e.g. org.eclipse.class#name).

logEnter

public static void logEnter(String id,
                            String description)
Log a method enter.

Parameters:
id - The method's unique identification (e.g. org.eclipse.class#name).
description - A description of the method.

logExit

public static void logExit(String id)
Log a method exit.

Parameters:
id - The method's unique identification (e.g. org.eclipse.class#name).

logExit

public static void logExit(String id,
                           String description)
Log a method exit.

Parameters:
id - The method's unique identification (e.g. org.eclipse.class#name).
description - A description of the method.

logTime

public static void logTime(String id,
                           String msg)
Log a message.

Parameters:
id - The method's unique identification (e.g. org.eclipse.class#name).
msg - The message.

logTime

public static void logTime(String id,
                           String msg,
                           String description)
Log a message.

Parameters:
id - The method's unique identification (e.g. org.eclipse.class#name).
msg - The message.
description - A description of the method.

logTime

public static void logTime(int flag,
                           String id,
                           String msg,
                           String description)
Log a message.

Parameters:
flag - A profile logging flag.
id - The method's unique identification (e.g. org.eclipse.class#name).
msg - The message.
description - A description of the method.
See Also:
FLAG_ENTER, FLAG_EXIT, FLAG_NONE

accumLogEnter

public static void accumLogEnter(String scope)
Use cumulative logging to record the entrance from this scope.

Parameters:
scope - The entering scope

accumLogExit

public static void accumLogExit(String scope)
Use cumulative logging to record the exit from this scope.

Parameters:
scope - The exiting scope

getProfileLog

public static String getProfileLog()
Get the profiling log report and reset the trace buffer.

Returns:
The profiling log report.


Copyright © 2007–2014 The Apache Software Foundation. All rights reserved.