|
Extension SDK 9.0.5 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectoracle.jdeveloper.profiler.ProfilerAPI
Utility class to provide code level support for the profiling features.
This class contains a set of static methods allowing code instrumentation for profiling. Instrumented code will run on any VM or in any mode with OJVM, but the instrumentation will be effective only if you run your program with OJVM in profiling mode. In any other cases the implementation is designed to be 'transparent' and add no execution penalty if the instrumentation is done properly.
Field Summary | |
static boolean |
isActive
|
Method Summary | |
static void |
addComment(int handle,
boolean o)
Add boolean to the event comment. |
static void |
addComment(int handle,
char o)
Add char to the event comment. |
static void |
addComment(int handle,
char[] o)
Add char[] to the event comment. |
static void |
addComment(int handle,
char[] o,
int offset,
int count)
Add part of char[] to the event comment. |
static void |
addComment(int handle,
double o)
Add double to the event comment. |
static void |
addComment(int handle,
float o)
Add float to the event comment. |
static void |
addComment(int handle,
int o)
Add int to the event comment. |
static void |
addComment(int handle,
long o)
Add long to the event comment. |
static void |
addComment(int handle,
java.lang.Object o)
Add to the event comment. |
static void |
addComment(int handle,
java.lang.String comment)
Add String comment to the event. |
static void |
addStackToComment(int handle)
Add the current stack as to the event comment. |
static void |
clearEventHistory()
Clear the event history. |
static void |
createEvent(int id,
long start,
long stop,
java.lang.String comment)
Create event. |
static void |
dumpEventHistory()
Dump event history. |
static void |
endEvent(int handle)
End an event. |
static void |
endEvent(int handle,
java.lang.String comment)
End an event. |
static java.lang.String |
getDMSParams()
Get DMS internal parameters. |
static long |
getTimer()
Get high performance timer. |
static boolean |
isEventActive(int event)
Check if this particular Event ID is active during this run. |
static void |
pulseEvent(int event,
java.lang.String comment)
Create a pulse event. |
static int |
startEvent(int event)
Start profiler event. |
static int |
startEvent(int event,
java.lang.String comment)
Start profiler event. |
static void |
startSampling()
Start sampling, this call must be paired with stopSampling(). |
static void |
stopSampling()
Stop sampling, this call must be paired with startSampling(). |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static boolean isActive
Method Detail |
public static void startSampling()
stopSampling()
public static void stopSampling()
startSampling()
public static int startEvent(int event, java.lang.String comment)
The returned handle which must be used for any further references to this event.
This call must be paired with a call to endEvent.
Multiple events with the same ID can be started and ended independently.
Start time and code position are evaluated during this call.
The comment String argument is stored within the VM, any futher comments will be appended.
If event profiler is not activated or this event is not active, the returned value is -1. All further calls to any event function will then return immediatly. It's why it's a good idea to initialize the handle to -1.
event
- Event ID.comment
- Comment.
endEvent(int)
,
endEvent(int, String)
public static int startEvent(int event)
The returned handle which must be used for any further references to this event.
This call must be paired with a call to endEvent.
Multiple events with the same ID can be started and ended independently.
Start time and code position are evaluated during this call.
If event profiler is not activated or this event is not active, the returned value is -1. All further calls to any event function will then return immediatly. It's why it's a good idea to initialize the handle to -1.
This call is equivalent to startEvent(event, null);
event
- Event ID.
endEvent(int)
,
endEvent(int, String)
public static void endEvent(int handle, java.lang.String comment)
This call must be paired with a call to startEvent. The Handler must have been provided by a startEvent function or be -1, any other value will be ignored and a warning will be sent on stderr.
Multiple events with the same ID can be started and ended independently.
End time is evaluated during this call.
The comment String argument appended to the current comment.
Once an event is ended, no further calls should be made using this particular handle. endEvent must be the last call to generate this event.
handle
- Event Handle.comment
- CommentendEvent(int)
,
startEvent(int, String)
,
startEvent(int)
public static void endEvent(int handle)
This call must be paired with a call to startEvent. The Handler must have been provided by a startEvent function or be -1, any other value will be ignored and a warning will be sent on stderr.
Multiple events with the same ID can be started and ended independently.
Equivalent to endEvent(handle, null); End time is evaluated during this call.
Once an event is ended, no further calls should be made using this particular handle. endEvent must be the last call to generate this event.
handle
- Event Handle.endEvent(int, String)
,
startEvent(int, String)
,
startEvent(int)
public static void pulseEvent(int event, java.lang.String comment)
Position, Start and End time are evaluated during this call.
This function allows you to create an event with no significant duration.
event
- Event ID.comment
- Comment.public static boolean isEventActive(int event)
event
- Event ID.
true
if active and profiling in active false
otherwise.public static void addComment(int handle, java.lang.String comment)
The comment is appended at the end of the current comment.
handle
- Event Handle.comment
- Comment to append.startEvent(int, String)
,
startEvent(int)
public static void addStackToComment(int handle)
The current stack is appended at the end of the current comment.
This function can be time and memory expensive, it's not advisable to use it for very common events.
handle
- Event Handle.startEvent(int, String)
,
startEvent(int)
public static void clearEventHistory()
public static void dumpEventHistory()
public static void addComment(int handle, java.lang.Object o)
o.toString() is appended at the end of the current comment.
handle
- Event Handle.o
- Object to append.startEvent(int, String)
,
startEvent(int)
public static void addComment(int handle, int o)
String.valueOf(o) is appended at the end of the current comment.
handle
- Event Handle.o
- int to append.startEvent(int, String)
,
startEvent(int)
public static void addComment(int handle, char o)
String.valueOf(o) is appended at the end of the current comment.
handle
- Event Handle.o
- char to append.startEvent(int, String)
,
startEvent(int)
public static void addComment(int handle, boolean o)
String.valueOf(o) is appended at the end of the current comment.
handle
- Event Handle.o
- boolean to append.startEvent(int, String)
,
startEvent(int)
public static void addComment(int handle, float o)
String.valueOf(o) is appended at the end of the current comment.
handle
- Event Handle.o
- float to append.startEvent(int, String)
,
startEvent(int)
public static void addComment(int handle, double o)
String.valueOf(o) is appended at the end of the current comment.
handle
- Event Handle.o
- double to append.startEvent(int, String)
,
startEvent(int)
public static void addComment(int handle, long o)
String.valueOf(o) is appended at the end of the current comment.
handle
- Event Handle.o
- long to append.startEvent(int, String)
,
startEvent(int)
public static void addComment(int handle, char[] o)
String.valueOf(o) is appended at the end of the current comment.
handle
- Event Handle.o
- char[] to append.startEvent(int, String)
,
startEvent(int)
public static void addComment(int handle, char[] o, int offset, int count)
String.valueOf(o, fffset, count) is appended at the end of the current comment.
handle
- Event Handle.o
- int to append.offset
- index of first char to append.count
- Number of char to append.startEvent(int, String)
,
startEvent(int)
public static long getTimer()
This method allows the user to get a time stamp at any given time to create events in a single call. This method can be usefull to coordinate start or end time of a group of events. Unless it's very important to have the exact same start or stop time it's strongly advised to use tha classical startEvent / endEvent logic to instrument your application.
createEvent(int ,long ,long ,String)
public static void createEvent(int id, long start, long stop, java.lang.String comment)
Code position are evaluated during this call.
id
- Event IDstart
- start timestop
- end timecomment
- event commentgetTimer()
public static java.lang.String getDMSParams()
This function shouldn't be used by anything else.
|
Extension SDK | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 1997, 2004, Oracle. All rights reserved.