clj-async-profiler icon indicating copy to clipboard operation
clj-async-profiler copied to clipboard

Possible to use as standalone application?

Open imrekoszo opened this issue 2 years ago • 4 comments

For some profiling where we cannot currently inject the profiler into the application we use the standard async-profiler by launching it from the command line with a process id specified, as described here: https://github.com/async-profiler/async-profiler/tree/v2.9#wall-clock-profiling

Can this be done using clj-async-profiler? If yes, could you please point me to where it is documented, as I haven't succeeded in finding it. If not, would it be in line with the goals of this project to have such an entry point made?

imrekoszo avatar Nov 21 '23 17:11 imrekoszo

Hi, yes, you can profile an external process with clj-async-profiler by providing :pid in the options map. This option is supported by start, ~profile~, andprofile-for.

I honestly haven't tested it lately with JDKs after 8, so please try it out and say whether it worked for you, thanks.

alexander-yakushev avatar Nov 21 '23 18:11 alexander-yakushev

Thank you. Am I correct in assuming one has to start a repl as described in https://clojure-goes-fast.com/kb/profiling/clj-async-profiler/startup/ and communicate with the profiler from there?

imrekoszo avatar Nov 21 '23 18:11 imrekoszo

Yup, sorry, should have mentioned that too.

alexander-yakushev avatar Nov 21 '23 18:11 alexander-yakushev

Thanks. I'm wondering if there is a good way to package up the app so it can be copied over to and executed on a machine that has no access to the internet

imrekoszo avatar Nov 21 '23 21:11 imrekoszo