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

The build time event spy should aggregate values for each mojo #430 #431

Merged
merged 1 commit into from Jun 18, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -16,6 +16,7 @@
package org.mvndaemon.mvnd.timing;

import java.util.Comparator;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
import java.util.Map.Entry;
Expand Down Expand Up @@ -110,10 +111,16 @@ private void doReport(boolean output) {
log.accept(DIVIDER);
log.accept("Build Time Summary:");
log.accept(DIVIDER);
Map<String, Long> mojos = new HashMap<>();
session.projects().forEach(p -> {
log.accept(String.format("%s [%.3fs]", p.name(), p.duration() / 1000d));
p.mojos().forEach(m -> log.accept(String.format(" %s [%.3fs]", m.name(), m.duration() / 1000d)));
p.mojos().forEach(m -> {
log.accept(String.format(" %s [%.3fs]", m.name(), m.duration() / 1000d));
mojos.merge(m.name(), m.duration(), Long::sum);
gnodet marked this conversation as resolved.
Show resolved Hide resolved
});
});
log.accept(DIVIDER);
mojos.forEach((name, duration) -> log.accept(String.format(" %s [%.3fs]", name, duration / 1000d)));
}

private static class Session {
Expand Down