Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement / activate perdormance profiling menu for Gradle projects #394

Open
gavenkoa opened this issue Jul 17, 2018 · 5 comments
Open

Comments

@gavenkoa
Copy link

It seems that plugin doesn't have support for application profiling.

Menu items for setting profiling breakpoints and launching profiles are disabled...

@kelemen
Copy link
Owner

kelemen commented Jul 17, 2018

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.

@gavenkoa
Copy link
Author

gavenkoa commented Jul 17, 2018

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")

@kelemen
Copy link
Owner

kelemen commented Jul 17, 2018

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.

@tcfurrer
Copy link

Has anyone already requested a Gradle enhancement to provide the java process ID?

Also... this seems overlapping with the previous issue: #106

@kelemen
Copy link
Owner

kelemen commented Jul 17, 2018

I don't know of such a request. It is a deeper issue than just getting the process ID for two reasons:

  1. The execute method of Gradle tasks block and so you can't simply just get the PID after starting.
  2. As far as I know there is no generic mechanism for the build to call back to the IDE (or whatever using the Tooling API). There are some special cases (like testing), so I'm guessing it wouldn't be impossible for Gradle.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants