|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK 11g Release 2 (11.1.2.0.0) E17493-01 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object oracle.ide.performance.PerformanceLogger
public final class PerformanceLogger
Performance logger should be used to log performance information that may be of interest to extension developers.
Performance logger must be used to log events on the same thread. When you
retrieve an instance of PerformanceLogger via the get()
method, a
unique logger for the current thread is returned.
Performance logger delegates all logging to an instance of
Logger
. For the purposes of configuring this
logger, its name is the same as the fully qualified name of this class
(oracle.ide.performance.PerformanceLogger).
Performance logger will log PerformanceLogRecord
instances to the
logger. These log records contain additional information about the logging
event used to format performance log messages.
The default handler used for performance log messages is configured with a formatter that prints indented timing information for each log record to the console. This is a typical example of the output:
Timing: [0ms] Started some long task... Timing: [300ms] Did some subtask Timing: [233ms] Did another subtask Timing: [550ms] Finished the long taskYou can change the default formatter by setting the logging property oracle.ide.performance.PerformanceHandler.formatter to the fully qualified class name of a
Formatter
.This handler is installed with a default filter that only allows log messages to be printed if the current build of JDeveloper is a debug build. In other words, in released production builds of JDeveloper, timing diagnostics are not displayed at all by default. You can override this behavior by setting the logging property oracle.ide.performance.PerformanceHandler.filter to an empty string.
Method Summary | |
---|---|
static PerformanceLogger |
get()
Get an instance of the performance logger. |
static boolean |
isAboveGlobalThreshold(long timingInNanos)
|
void |
log(java.util.logging.Level level,
java.lang.String message)
Deprecated. |
void |
log(java.util.logging.Level level,
java.lang.String message,
long elapsedTime)
Deprecated. |
void |
log(java.lang.String id,
java.lang.String message,
long elapsedTime)
Log a message with an elapsed time. |
void |
logConfigurationProperty(java.lang.String key,
java.lang.String value)
|
void |
startTiming(java.lang.String id)
Start timing some long operation. |
void |
startTiming(java.lang.String id,
java.lang.String startMessage)
Start timing some long operation and log a start message. |
void |
stopTiming(java.lang.String id,
int threshold,
java.lang.String endMessage,
java.lang.Object... arguments)
Stop timing some long operation. |
void |
stopTiming(java.lang.String id,
java.lang.String endMessage)
Stop timing some long operation and log an end message that includes the elapsed time in milliseconds of the operation. |
void |
stopTiming(java.lang.String id,
java.lang.String endMessage,
int threshold)
Stop timing some long operation. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public void logConfigurationProperty(java.lang.String key, java.lang.String value)
public static PerformanceLogger get()
@Deprecated public void log(java.util.logging.Level level, java.lang.String message)
@Deprecated public void log(java.util.logging.Level level, java.lang.String message, long elapsedTime)
public void log(java.lang.String id, java.lang.String message, long elapsedTime)
id
- the id of the type of performance statistic being tracked.message
- parameterized information about the performance statistic.elapsedTime
- the elapsed time in nanoseconds.public void startTiming(java.lang.String id)
id
- a unique identifier for the operation.public void startTiming(java.lang.String id, java.lang.String startMessage)
id
- a unique identifier for the operation.startMessage
- a message to log. The message will be logged at
Level.INFO
.public void stopTiming(java.lang.String id, java.lang.String endMessage)
id
- the id of an operation. Must match an id previously registered
with startTiming( String, String )
.endMessage
- the message for the log record.
java.lang.IllegalArgumentException
- if the specified id is unrecognized.public void stopTiming(java.lang.String id, java.lang.String endMessage, int threshold)
id
- the id of an operation. Must match an id previously registered
with startTiming( String, String )
.endMessage
- the message for the log record.threshold
- the minimum time required to print the message
java.lang.IllegalArgumentException
- if the specified id is unrecognized.public void stopTiming(java.lang.String id, int threshold, java.lang.String endMessage, java.lang.Object... arguments)
id
- the id of an operation. Must match an id previously registered
with startTiming( String, String )
.threshold
- the minimum time required to print the messageendMessage
- the message for the log record.arguments
- arguments to be formatted into endMessage
using MessageFormat.format(java.lang.Object[], java.lang.StringBuffer, java.text.FieldPosition)
.
java.lang.IllegalArgumentException
- if the specified id is unrecognized.public static boolean isAboveGlobalThreshold(long timingInNanos)
|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK 11g Release 2 (11.1.2.0.0) E17493-01 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |