|
Extension SDK 10.1.2 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object oracle.ide.util.IdeProfile
This class wraps the OJVM Event Profiler.
The reason for not using the ProfilerAPI directly is basically that oracle.ide cannot depend on oracle.jdeveloper.The following code is an example on how to instrument your code: Example:
{ int handle = IdeProfile.startEvent(handle, IdeProfile.PROF_XXX, "Hello"); ... IdeProfile.endEvent(handle); }
If your String comment is constructed (ex: this.toString()
)
it is preferable to check the isActive() method to determine if it is
necessary to call the IdeProfile.startEvent(toString())
There is a better way to instrument the code using the
void startEvent(int[], ...)
methods. This call is equivalent to
int startEvent(int, String)
except that the call can
be totally excluded from the class file using the -exclude compiler
parameter and the allocated event[] is will be removed by the optimizer.
{ int[] handle = new int[1]; if (IdeProfile.isActive()) { IdeProfile.startEvent(handle, IdeProfile.PROF_XXX, "Hello"); } ... IdeProfile.endEvent(handle); }
Field Summary | |
static int |
PROF_CMT_FIRST
|
static int |
PROF_CMT_LAST
|
static int |
PROF_DEBUGGER_FIRST
|
static int |
PROF_DEBUGGER_LAST
|
static int |
PROF_DOCK_LAYOUT
Measure the time needed to re-layout the docked windows |
static int |
PROF_EJB_FIRST
|
static int |
PROF_EJB_LAST
|
static int |
PROF_FIRST
|
static int |
PROF_GENERIC
Deprecated. because you are not supposed to checkin code with this ID. |
static int |
PROF_IDE_FIRST
|
static int |
PROF_IDE_LAST
|
static int |
PROF_IDEIMPL_FIRST
|
static int |
PROF_IDEIMPL_LAST
|
static int |
PROF_INIT_ADDINS
Measures the initialization of the addins |
static int |
PROF_JDEVELOPER_FIRST
|
static int |
PROF_JDEVELOPER_LAST
|
static int |
PROF_JDEVIMPL_FIRST
|
static int |
PROF_JDEVIMPL_LAST
|
static int |
PROF_JOT_FIRST
|
static int |
PROF_JOT_LAST
|
static int |
PROF_KEYPRESSED
Pulse an event every time a key is pressed. |
static int |
PROF_LOAD_ADDINS
Measures the load of the addins |
static int |
PROF_NOTIFY_OBSERVERS
Event for calls to IdeSubject.notifyObserver |
static int |
PROF_STARTUP
Measures the startup of the IDE |
Constructor Summary | |
IdeProfile()
|
Method Summary | |
static void |
endEvent(int handle)
Stop a profiler event |
static void |
endEvent(int[] handle)
Stop a profiler event |
static void |
endEvent(int[] handle,
java.lang.String comment)
Stop a profiler event |
static void |
endEvent(int handle,
java.lang.String comment)
Stop a profiler event |
static Profiler |
getCurrentIdeProfiler()
Returns the profiler currently plugged for the IDE |
static boolean |
isActive()
|
static boolean |
isEventActive(int eventID)
|
static void |
pulseEvent(int event,
java.lang.String comment)
Pulse a profiler event |
static void |
setCurrentIdeProfiler(Profiler profiler)
Plugs a new profiler. |
static void |
setCurrentIdeProfiler(java.lang.String sProfilerClassName)
Plugs a new profiler This method is called from Ide.startupImpl(). |
static int |
startEvent(int event)
Starts a profiler event |
static void |
startEvent(int[] handle,
int event)
Starts a profiler event |
static void |
startEvent(int[] handle,
int event,
java.lang.String comment)
Starts a profiler event |
static int |
startEvent(int event,
java.lang.String comment)
Starts a profiler event |
static void |
startSampling()
Start profiler sampling |
static void |
stopSampling()
Stop profiler sampling |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static int PROF_FIRST
public static final int PROF_GENERIC
public static final int PROF_STARTUP
public static final int PROF_LOAD_ADDINS
public static final int PROF_INIT_ADDINS
public static final int PROF_KEYPRESSED
public static final int PROF_DOCK_LAYOUT
public static final int PROF_NOTIFY_OBSERVERS
public static final int PROF_JOT_FIRST
public static final int PROF_JOT_LAST
public static final int PROF_CMT_FIRST
public static final int PROF_CMT_LAST
public static final int PROF_IDE_FIRST
public static final int PROF_IDE_LAST
public static final int PROF_IDEIMPL_FIRST
public static final int PROF_IDEIMPL_LAST
public static final int PROF_JDEVELOPER_FIRST
public static final int PROF_JDEVELOPER_LAST
public static final int PROF_JDEVIMPL_FIRST
public static final int PROF_JDEVIMPL_LAST
public static final int PROF_EJB_FIRST
public static final int PROF_EJB_LAST
public static final int PROF_DEBUGGER_FIRST
public static final int PROF_DEBUGGER_LAST
Constructor Detail |
public IdeProfile()
Method Detail |
public static Profiler getCurrentIdeProfiler()
public static void setCurrentIdeProfiler(Profiler profiler)
profiler
- the new profilerpublic static void setCurrentIdeProfiler(java.lang.String sProfilerClassName)
public static boolean isActive()
public static boolean isEventActive(int eventID)
public static int startEvent(int event, java.lang.String comment)
event
- the event IDcomment
- comments you want to see in the profile report
public static int startEvent(int event)
event
- the event ID
public static void startEvent(int[] handle, int event, java.lang.String comment)
handle
- the event handle to be used in the endEvent callevent
- the event IDcomment
- comments you want to see in the profile reportpublic static void startEvent(int[] handle, int event)
handle
- the event handle to be used in the endEvent callevent
- the event IDpublic static void endEvent(int handle, java.lang.String comment)
handle
- the event handle returned by the startEvent callcomment
- comments you want to see in the profile reportpublic static void endEvent(int handle)
handle
- the event handle returned by the startEvent callpublic static void endEvent(int[] handle, java.lang.String comment)
handle
- the event handle returned by the startEvent callcomment
- comments you want to see in the profile reportpublic static void endEvent(int[] handle)
handle
- the event handle returned by the startEvent callpublic static void pulseEvent(int event, java.lang.String comment)
event
- the event IDcomment
- comments you want to see in the profile reportpublic static void startSampling()
public static void stopSampling()
|
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.