automatically open GUI

Questions about YourKit Java Profiler
Locked
mgroth49
Posts: 8
Joined: Sat Nov 12, 2022 3:42 pm

automatically open GUI

Post by mgroth49 »

I am evaluating YourKit and interested in how I can automate the process of opening the GUI and connect to a process.

I am not so interested in IDE integration because it doesn't tend to work for me. I do execute my java process through gradle on IntelliJ, but maybe I am changing so much configuration that it is not working.

I would be most comfortable being able set everything up in the command line (then I can configure gradle to use the correct command line arguments).

For my java process, I have:

Code: Select all

-agentpath:/Applications/YourKit-Java-Profiler-2022.9.app/Contents/Resources/bin/mac/libyjpagent.dylib=port=65050
And the seems to work. I can manually open the YourKit GUI and connect to this process and see analyses.

However, what I really want is for the above step to be automated.

I saw this post: viewtopic.php?p=59076&hilit=gui#p59076

It said something about `-agentport=<port>` but I could not figure out how to use this. I tried running `profiler.sh -agenpath=<port>`. The GUI openned normally and did not automatically connect to the agent at that port.

I am no expert on profiler tools, so apologies if I am misunderstanding something.
Vladimir Kondratyev
Posts: 1619
Joined: Tue Aug 10, 2004 7:52 pm

Re: automatically open GUI

Post by Vladimir Kondratyev »

There is undocumented profiler agent option "profiler_dir" which does exactly what you need. If it presents, then agent will launch profiler UI and connect it to the profiled Java process.
I am not so interested in IDE integration because it doesn't tend to work for me.
What is the problem with IDE integration. We will be happy to fix it.

Best regards,
Vladimir Kondratyev
YourKit GmbH
http://www.yourkit.com
"Don't get lost in data, get information!"
mgroth49
Posts: 8
Joined: Sat Nov 12, 2022 3:42 pm

Re: automatically open GUI

Post by mgroth49 »

profile_dir works. Thanks!
Locked