Event Profiling in JDeveloper

It's been quite a while since I last demoed the event profiler in JDeveloper. I think the last time I did it was in 2002 at the iDevelop conference.

Anyway, I figured out that for the type of developers that come to Javaone this thing might be interesting.

I remembered that there was a way to define your own events for tracking. But I couldn't remember how you do it. Rob came up with the answer, and I'm putting it down here in case I'll forget it again.

All you need to do is add import oracle.jdeveloper.profiler.ProfilerAPI;

to your class (you'll need to add the JDeveloper SDK library to your project's libraries).

Then in your code add something like this when the event you want to track starts:

int my_event_id;

my_event_id=ProfilerAPI.startEvent(1234,"my event");

Then you have your event code, and after the code is finished add this line:

ProfilerAPI.endEvent(my_event_id);

Now when you run the event profiler in JDeveloper it will show your event if and when it is invoked.

You control which events are shown in the profilers->events preferences under your project properties and this is where you can add an entry for your event - set the color etc.

Comments:

Post a Comment:
  • HTML Syntax: NOT allowed
About

me
I'm a Director of Product Management for the Oracle Java Development Tools.
Follow me:
Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today