maven-profiler icon indicating copy to clipboard operation
maven-profiler copied to clipboard

Plugin total impact

Open delanym opened this issue 4 years ago • 2 comments

Can the HTML include a table with the cumulative reactor time for each plugin execution?

delanym avatar Jan 06 '21 07:01 delanym

Could you give an example ? Will you be interested in contributing it ?

jcgay avatar Jan 06 '21 09:01 jcgay

You could sum up the plugin execution times for the project's modules. That would produce a JSON like

{
  "mojo": "org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile {execution: default-compile}",
  "time": "765 ms",
  "moduleTime": "312611 ms"
}

But then the table for the parent project would include plugins that didn't run on it, and the HTML would get quite heavy.

Another way would be to make a single table with the vertical axis as all plugin executions, and the horizontal as projects. The order of the executions must be lost, but I don't think that's such an issue. In such a table you'd have to add the module times to the project, so that won't work.

The question is, what am I going to do with this information? I really just want to see how the addition of a plugin slows down my build. I can't see that when the plugin's affect is spread over 500 projects. So I would be content with a list of totals for all plugin executions run in the build, in descending times, i.e. add a mojos array to the root of the JSON.

{
  "name": "My Top Level Project",
  "profile_name": "",
  "time": "356356 ms",
    "mojos": [{
      ...

Maybe one of these days I'll get into writing Java :)

delanym avatar Jan 06 '21 10:01 delanym