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

Aggregate duration for lifecycle phases #4

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

camshoff
Copy link

@camshoff camshoff commented Sep 7, 2016

For multi-module projects, the ouput section "Plugins in lifecycle Phases" lists each single plugin execution per phase with associated duration:

[INFO] package:
[INFO]       12 ms: org.apache.maven.plugins:maven-jar-plugin:2.6:jar:default-jar
[INFO]        1 ms: org.apache.maven.plugins:maven-site-plugin:3.4:attach-descriptor:attach-descriptor
[INFO]       18 ms: org.apache.maven.plugins:maven-jar-plugin:2.6:test-jar:test-jar
[INFO]        1 ms: org.apache.maven.plugins:maven-site-plugin:3.4:attach-descriptor:attach-descriptor
[INFO]       39 ms: org.apache.maven.plugins:maven-jar-plugin:2.6:jar:default-jar
[INFO]       34 ms: org.apache.maven.plugins:maven-jar-plugin:2.6:jar:default-jar
[INFO]       73 ms: org.apache.maven.plugins:maven-dependency-plugin:2.10:copy-dependencies:copy-dependencies
[INFO]        1 ms: org.apache.maven.plugins:maven-site-plugin:3.4:attach-descriptor:attach-descriptor
[INFO]      240 ms: org.apache.maven.plugins:maven-jar-plugin:2.6:jar:default-jar
...

I think this output can be improved with my changes, by aggregating the execution times for each plugin for all executions, and show them in descending order:

[INFO] package:
[INFO]    19839 ms: org.apache.maven.plugins:maven-assembly-plugin:2.5.5:single:make-assembly
[INFO]     1288 ms: org.apache.maven.plugins:maven-jar-plugin:2.6:jar:default-jar
[INFO]      856 ms: org.apache.maven.plugins:maven-jar-plugin:2.6:test-jar:test-jar
[INFO]      718 ms: org.apache.maven.plugins:maven-site-plugin:3.4:attach-descriptor:attach-descriptor
[INFO]       54 ms: org.apache.maven.plugins:maven-dependency-plugin:2.10:copy-dependencies:copy-dependencies

…es are now aggregated per plugin and the list of plugins is sorted descending with respect to summarized execution time
@camshoff
Copy link
Author

camshoff commented Sep 7, 2016

I just saw this PR also contains the previous changes...
Sorry for that, this is my first Git experience and I still need to learn ;)

@khmarbaise
Copy link
Owner

No problem...The output for each plugin in every project was intentional...so may be I can implement a flag/option to aggregate the results..WDYT?

@camshoff
Copy link
Author

Well, since you don't see the project here for the listed executions, it's hard to tell which project of the reactor is associated with each plugin execution. Also, I think the information about the overall duration of a particular plugin has some benefit.
A flag/option to switch is fine for me, but how about printing that detailed information as part of the first output section "Project Build Time (reactor order)", like this:

[INFO] xxx-xxxx-xxx-batch-cm:
[INFO]            4 ms : validate
[INFO]                      3 ms: org.apache.maven.plugins:maven-enforcer-plugin:1.4.1:display-info:display-info
[INFO]                      1 ms: org.apache.maven.plugins:maven-enforcer-plugin:1.4.1:enforce:enforce-versions
    ...
[INFO]          108 ms : package
[INFO]                     34 ms: org.apache.maven.plugins:maven-jar-plugin:2.6:jar:default-jar
[INFO]                     73 ms: org.apache.maven.plugins:maven-dependency-plugin:2.10:copy-dependencies:copy-dependencies
[INFO]                      1 ms: org.apache.maven.plugins:maven-site-plugin:3.4:attach-descriptor:attach-descriptor

@khmarbaise
Copy link
Owner

You point is a good one...So I need to add the project from where the plugin has run....I will take a look...

clayreimann added a commit to clayreimann/maven-buildtime-profiler that referenced this pull request May 19, 2022
For multi-module projects there is currently no indication of which project caused a particular mojo execution. This is an alternate solution to khmarbaise#4.

Current output:
```
[INFO] generate-sources:
[INFO]        1 ms: org.codehaus.mojo:build-helper-maven-plugin:3.3.0:add-source:add-antlr-sources
[INFO]        0 ms: org.codehaus.mojo:build-helper-maven-plugin:3.3.0:add-source:add-antlr-sources
[INFO]     3247 ms: com.twitter:scrooge-maven-plugin:20.1.0:compile:thrift-sources
[INFO]        1 ms: org.codehaus.mojo:build-helper-maven-plugin:3.3.0:add-source:add-antlr-sources
[INFO]     1703 ms: com.twitter:scrooge-maven-plugin:20.1.0:compile:thrift-sources
[INFO]        1 ms: org.codehaus.mojo:build-helper-maven-plugin:3.3.0:add-source:add-antlr-sources
[INFO]        0 ms: org.codehaus.mojo:build-helper-maven-plugin:3.3.0:add-source:add-antlr-sources
[INFO]        0 ms: org.codehaus.mojo:build-helper-maven-plugin:3.3.0:add-source:add-antlr-sources
[INFO]        0 ms: org.codehaus.mojo:build-helper-maven-plugin:3.3.0:add-source:add-antlr-sources
[INFO]        0 ms: org.codehaus.mojo:build-helper-maven-plugin:3.3.0:add-source:add-antlr-sources
[INFO]        0 ms: org.codehaus.mojo:build-helper-maven-plugin:3.3.0:add-source:add-antlr-sources
[INFO]        0 ms: org.codehaus.mojo:build-helper-maven-plugin:3.3.0:add-source:add-antlr-sources
[INFO]        1 ms: org.codehaus.mojo:build-helper-maven-plugin:3.3.0:add-source:add-antlr-sources
[INFO]        1 ms: org.codehaus.mojo:build-helper-maven-plugin:3.3.0:add-source:add-antlr-sources
[INFO]        0 ms: org.codehaus.mojo:build-helper-maven-plugin:3.3.0:add-source:add-antlr-sources
[INFO]        1 ms: org.codehaus.mojo:build-helper-maven-plugin:3.3.0:add-source:add-antlr-sources
[INFO]      132 ms: com.twitter:scrooge-maven-plugin:20.1.0:compile:thrift-sources
[INFO]        1 ms: org.codehaus.mojo:build-helper-maven-plugin:3.3.0:add-source:add-antlr-sources
[INFO]        0 ms: org.codehaus.mojo:build-helper-maven-plugin:3.3.0:add-source:add-antlr-sources
[INFO]        2 ms: org.codehaus.mojo:build-helper-maven-plugin:3.3.0:add-source:add-antlr-sources
[INFO]        0 ms: org.codehaus.mojo:build-helper-maven-plugin:3.3.0:add-source:add-antlr-sources
[INFO]        0 ms: org.codehaus.mojo:build-helper-maven-plugin:3.3.0:add-source:add-antlr-sources
[INFO]      303 ms: com.twitter:scrooge-maven-plugin:20.1.0:compile:thrift-sources
[INFO]      531 ms: org.antlr:antlr4-maven-plugin:4.9.3:antlr4:antlr
[INFO]        1 ms: org.codehaus.mojo:build-helper-maven-plugin:3.3.0:add-source:add-antlr-sources
[INFO]        1 ms: org.codehaus.mojo:build-helper-maven-plugin:3.3.0:add-source:add-antlr-sources
[INFO]        1 ms: org.codehaus.mojo:build-helper-maven-plugin:3.3.0:add-source:add-antlr-sources
[INFO]     1423 ms: org.antlr:antlr4-maven-plugin:4.9.3:antlr4:antlr
[INFO]        0 ms: org.codehaus.mojo:build-helper-maven-plugin:3.3.0:add-source:add-antlr-sources
[INFO]      117 ms: org.codehaus.mojo:build-helper-maven-plugin:3.3.0:add-source:add-antlr-sources
[INFO]     1987 ms: org.antlr:antlr4-maven-plugin:4.9.3:antlr4:antlr
[INFO]        1 ms: org.codehaus.mojo:build-helper-maven-plugin:3.3.0:add-source:add-antlr-sources
[INFO]        0 ms: org.codehaus.mojo:build-helper-maven-plugin:3.3.0:add-source:add-antlr-sources
[INFO]        1 ms: org.codehaus.mojo:build-helper-maven-plugin:3.3.0:add-source:add-antlr-sources
[INFO]        1 ms: org.codehaus.mojo:build-helper-maven-plugin:3.3.0:add-source:add-antlr-sources
[INFO]        1 ms: org.codehaus.mojo:build-helper-maven-plugin:3.3.0:add-source:add-antlr-sources
[INFO]        1 ms: org.codehaus.mojo:build-helper-maven-plugin:3.3.0:add-source:add-antlr-sources
[INFO]        0 ms: org.codehaus.mojo:build-helper-maven-plugin:3.3.0:add-source:add-antlr-sources
```

New output:
```
[INFO] Plugins in lifecycle Phases:
[INFO]
[INFO] clean:
[INFO]      126 ms : Maven :: Build Time Profiler@org.apache.maven.plugins:maven-clean-plugin:3.1.0:clean (default-clean)
[INFO] validate:
[INFO]      145 ms : Maven :: Build Time Profiler@org.apache.maven.plugins:maven-enforcer-plugin:3.0.0:enforce (enforce-maven)
[INFO] initialize:
[INFO]       85 ms : Maven :: Build Time Profiler@org.jacoco:jacoco-maven-plugin:0.8.8:prepare-agent (default)
[INFO] generate-sources:
[INFO]      137 ms : Maven :: Build Time Profiler@org.codehaus.mojo:templating-maven-plugin:1.0.0:filter-sources (default)
[INFO] process-resources:
[INFO]       74 ms : Maven :: Build Time Profiler@org.apache.maven.plugins:maven-resources-plugin:3.2.0:resources (default-resources)
[INFO] compile:
[INFO]      837 ms : Maven :: Build Time Profiler@org.apache.maven.plugins:maven-compiler-plugin:3.10.0:compile (default-compile)
[INFO] process-classes:
[INFO]       54 ms : Maven :: Build Time Profiler@org.sonatype.plugins:sisu-maven-plugin:1.1:main-index (generate-index)
[INFO] process-test-resources:
[INFO]        2 ms : Maven :: Build Time Profiler@org.apache.maven.plugins:maven-resources-plugin:3.2.0:testResources (default-testResources)
[INFO] test-compile:
[INFO]      278 ms : Maven :: Build Time Profiler@org.apache.maven.plugins:maven-compiler-plugin:3.10.0:testCompile (default-testCompile)
[INFO] test:
[INFO]     3117 ms : Maven :: Build Time Profiler@org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M6:test (default-test)
[INFO] package:
[INFO]      504 ms : Maven :: Build Time Profiler@org.apache.maven.plugins:maven-site-plugin:3.11.0:attach-descriptor (attach-descriptor)
[INFO]       89 ms : Maven :: Build Time Profiler@org.apache.maven.plugins:maven-shade-plugin:3.3.0:shade (default)
[INFO]      267 ms : Maven :: Build Time Profiler@org.apache.maven.plugins:maven-jar-plugin:3.2.2:jar (default-jar)
[INFO] verify:
[INFO]      228 ms : Maven :: Build Time Profiler@org.jacoco:jacoco-maven-plugin:0.8.8:report (default)
[INFO] install:
[INFO]       67 ms : Maven :: Build Time Profiler@org.apache.maven.plugins:maven-install-plugin:3.0.0-M1:install (default-install)
```
clayreimann added a commit to clayreimann/maven-buildtime-profiler that referenced this pull request May 19, 2022
For multi-module projects there is currently no indication of which project caused a particular mojo execution. This is an alternate solution to khmarbaise#4.

Current output:
```
[INFO] generate-sources:
[INFO]        1 ms: org.codehaus.mojo:build-helper-maven-plugin:3.3.0:add-source:add-antlr-sources
[INFO]        0 ms: org.codehaus.mojo:build-helper-maven-plugin:3.3.0:add-source:add-antlr-sources
[INFO]     3247 ms: com.twitter:scrooge-maven-plugin:20.1.0:compile:thrift-sources
[INFO]        1 ms: org.codehaus.mojo:build-helper-maven-plugin:3.3.0:add-source:add-antlr-sources
[INFO]     1703 ms: com.twitter:scrooge-maven-plugin:20.1.0:compile:thrift-sources
[INFO]        1 ms: org.codehaus.mojo:build-helper-maven-plugin:3.3.0:add-source:add-antlr-sources
[INFO]        0 ms: org.codehaus.mojo:build-helper-maven-plugin:3.3.0:add-source:add-antlr-sources
[INFO]        0 ms: org.codehaus.mojo:build-helper-maven-plugin:3.3.0:add-source:add-antlr-sources
[INFO]        0 ms: org.codehaus.mojo:build-helper-maven-plugin:3.3.0:add-source:add-antlr-sources
[INFO]        0 ms: org.codehaus.mojo:build-helper-maven-plugin:3.3.0:add-source:add-antlr-sources
[INFO]        0 ms: org.codehaus.mojo:build-helper-maven-plugin:3.3.0:add-source:add-antlr-sources
[INFO]        0 ms: org.codehaus.mojo:build-helper-maven-plugin:3.3.0:add-source:add-antlr-sources
[INFO]        1 ms: org.codehaus.mojo:build-helper-maven-plugin:3.3.0:add-source:add-antlr-sources
[INFO]        1 ms: org.codehaus.mojo:build-helper-maven-plugin:3.3.0:add-source:add-antlr-sources
[INFO]        0 ms: org.codehaus.mojo:build-helper-maven-plugin:3.3.0:add-source:add-antlr-sources
[INFO]        1 ms: org.codehaus.mojo:build-helper-maven-plugin:3.3.0:add-source:add-antlr-sources
[INFO]      132 ms: com.twitter:scrooge-maven-plugin:20.1.0:compile:thrift-sources
[INFO]        1 ms: org.codehaus.mojo:build-helper-maven-plugin:3.3.0:add-source:add-antlr-sources
[INFO]        0 ms: org.codehaus.mojo:build-helper-maven-plugin:3.3.0:add-source:add-antlr-sources
[INFO]        2 ms: org.codehaus.mojo:build-helper-maven-plugin:3.3.0:add-source:add-antlr-sources
[INFO]        0 ms: org.codehaus.mojo:build-helper-maven-plugin:3.3.0:add-source:add-antlr-sources
[INFO]        0 ms: org.codehaus.mojo:build-helper-maven-plugin:3.3.0:add-source:add-antlr-sources
[INFO]      303 ms: com.twitter:scrooge-maven-plugin:20.1.0:compile:thrift-sources
[INFO]      531 ms: org.antlr:antlr4-maven-plugin:4.9.3:antlr4:antlr
[INFO]        1 ms: org.codehaus.mojo:build-helper-maven-plugin:3.3.0:add-source:add-antlr-sources
[INFO]        1 ms: org.codehaus.mojo:build-helper-maven-plugin:3.3.0:add-source:add-antlr-sources
[INFO]        1 ms: org.codehaus.mojo:build-helper-maven-plugin:3.3.0:add-source:add-antlr-sources
[INFO]     1423 ms: org.antlr:antlr4-maven-plugin:4.9.3:antlr4:antlr
[INFO]        0 ms: org.codehaus.mojo:build-helper-maven-plugin:3.3.0:add-source:add-antlr-sources
[INFO]      117 ms: org.codehaus.mojo:build-helper-maven-plugin:3.3.0:add-source:add-antlr-sources
[INFO]     1987 ms: org.antlr:antlr4-maven-plugin:4.9.3:antlr4:antlr
[INFO]        1 ms: org.codehaus.mojo:build-helper-maven-plugin:3.3.0:add-source:add-antlr-sources
[INFO]        0 ms: org.codehaus.mojo:build-helper-maven-plugin:3.3.0:add-source:add-antlr-sources
[INFO]        1 ms: org.codehaus.mojo:build-helper-maven-plugin:3.3.0:add-source:add-antlr-sources
[INFO]        1 ms: org.codehaus.mojo:build-helper-maven-plugin:3.3.0:add-source:add-antlr-sources
[INFO]        1 ms: org.codehaus.mojo:build-helper-maven-plugin:3.3.0:add-source:add-antlr-sources
[INFO]        1 ms: org.codehaus.mojo:build-helper-maven-plugin:3.3.0:add-source:add-antlr-sources
[INFO]        0 ms: org.codehaus.mojo:build-helper-maven-plugin:3.3.0:add-source:add-antlr-sources
```

New output:
```
[INFO] Plugins in lifecycle Phases:
[INFO]
[INFO] clean:
[INFO]      126 ms : Maven :: Build Time Profiler@org.apache.maven.plugins:maven-clean-plugin:3.1.0:clean (default-clean)
[INFO] validate:
[INFO]      145 ms : Maven :: Build Time Profiler@org.apache.maven.plugins:maven-enforcer-plugin:3.0.0:enforce (enforce-maven)
[INFO] initialize:
[INFO]       85 ms : Maven :: Build Time Profiler@org.jacoco:jacoco-maven-plugin:0.8.8:prepare-agent (default)
[INFO] generate-sources:
[INFO]      137 ms : Maven :: Build Time Profiler@org.codehaus.mojo:templating-maven-plugin:1.0.0:filter-sources (default)
[INFO] process-resources:
[INFO]       74 ms : Maven :: Build Time Profiler@org.apache.maven.plugins:maven-resources-plugin:3.2.0:resources (default-resources)
[INFO] compile:
[INFO]      837 ms : Maven :: Build Time Profiler@org.apache.maven.plugins:maven-compiler-plugin:3.10.0:compile (default-compile)
[INFO] process-classes:
[INFO]       54 ms : Maven :: Build Time Profiler@org.sonatype.plugins:sisu-maven-plugin:1.1:main-index (generate-index)
[INFO] process-test-resources:
[INFO]        2 ms : Maven :: Build Time Profiler@org.apache.maven.plugins:maven-resources-plugin:3.2.0:testResources (default-testResources)
[INFO] test-compile:
[INFO]      278 ms : Maven :: Build Time Profiler@org.apache.maven.plugins:maven-compiler-plugin:3.10.0:testCompile (default-testCompile)
[INFO] test:
[INFO]     3117 ms : Maven :: Build Time Profiler@org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M6:test (default-test)
[INFO] package:
[INFO]      504 ms : Maven :: Build Time Profiler@org.apache.maven.plugins:maven-site-plugin:3.11.0:attach-descriptor (attach-descriptor)
[INFO]       89 ms : Maven :: Build Time Profiler@org.apache.maven.plugins:maven-shade-plugin:3.3.0:shade (default)
[INFO]      267 ms : Maven :: Build Time Profiler@org.apache.maven.plugins:maven-jar-plugin:3.2.2:jar (default-jar)
[INFO] verify:
[INFO]      228 ms : Maven :: Build Time Profiler@org.jacoco:jacoco-maven-plugin:0.8.8:report (default)
[INFO] install:
[INFO]       67 ms : Maven :: Build Time Profiler@org.apache.maven.plugins:maven-install-plugin:3.0.0-M1:install (default-install)
```
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

Successfully merging this pull request may close these issues.

2 participants