Agent api

Questions about YourKit Java Profiler
Post Reply
alex
Posts: 6
Joined: Tue Feb 09, 2010 8:41 pm

Agent api

Post by alex »

Is there a way to start and stop profiling from inside the profiled application itself programmatically ?
I'd like to profile a section of code only when certain application conditions are met, i.e. in app code I would like to make a temporary change and have something like this:

try {
if (app conditions) {
Profiler.startCpuProfiling();
}
....
} finally {
Profiler.captureSnapshot("snapshotfile");
}
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Re: Agent api

Post by Anton Katilin »

Post Reply