Open gavenkoa opened 6 years ago
The problem is that NB needs the pid of the started java process but I can't get the pid from the Gradle task. So, as is now, you need to start the process and then attach to it.
Actually I haven't thought about attaching to process, managed by Gradle.
I think about launching "main" method with provided by Gradle classpath. That way it is possible to reuse profiler startup logic from Maven implementation...
There is option for attaching to running process and https://visualvm.github.io/startupprofiler.html for profiling startup.
I adore profiling breakpoints so only selected part of application will be profiled in automated / reproducible way. But menu item for placing breakpoints is disabled (that is "Insert profiling point")
Though currently, practically every action is associated with a Gradle command, so it would be a little inconsistent (i.e., starting the process via the profiler would ignore whatever was configured for the run task). Also, this is a bigger change since currently there is nothing in the code to support manually forking a new JVM and track that process.
Has anyone already requested a Gradle enhancement to provide the java process ID?
Also... this seems overlapping with the previous issue: https://github.com/kelemen/netbeans-gradle-project/issues/106
I don't know of such a request. It is a deeper issue than just getting the process ID for two reasons:
It seems that plugin doesn't have support for application profiling.
Menu items for setting profiling breakpoints and launching profiles are disabled...