Skip to content

Commit

Permalink
#3468 more time to show
Browse files Browse the repository at this point in the history
  • Loading branch information
yegor256 committed Nov 6, 2024
1 parent 181655b commit 389dd3e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ public final class OptimizeMojo extends SafeMojo {

@Override
public void exec() {
final long start = System.currentTimeMillis();
final Collection<ForeignTojo> tojos = this.scopedTojos().withXmir();
final Optimization optimization = this.optimization();
final int total = new SumOf(
Expand All @@ -101,8 +102,9 @@ public void exec() {
if (total > 0) {
Logger.info(
this,
"Optimized %d out of %d XMIR program(s)", total,
tojos.size()
"Optimized %d out of %d XMIR program(s) in %[ms]s",
total, tojos.size(),
System.currentTimeMillis() - start
);
} else {
Logger.debug(this, "No XMIR programs out of %d optimized", tojos.size());
Expand Down
16 changes: 11 additions & 5 deletions eo-maven-plugin/src/main/java/org/eolang/maven/ProbeMojo.java
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ public void exec() throws IOException {
"No programs were probed because eo.offline flag is TRUE"
);
} else {
final long start = System.currentTimeMillis();
if (this.hash == null) {
this.hash = new ChCached(
new ChNarrow(
Expand All @@ -116,7 +117,7 @@ public void exec() throws IOException {
final Path src = tojo.shaken();
final Collection<ObjectName> objects = this.probes(src);
if (!objects.isEmpty()) {
Logger.info(this, "Probing object(s): %s", objects);
Logger.debug(this, "Probing object(s): %s", objects);
}
int count = 0;
for (final ObjectName object : objects) {
Expand Down Expand Up @@ -144,8 +145,10 @@ public void exec() throws IOException {
);
} else {
Logger.info(
this, "Found %d probe(s) in %d program(s): %s",
probed.size(), tojos.size(), probed
this, "Found %d probe(s) in %d program(s) in %[ms]s: %s",
probed.size(), tojos.size(),
System.currentTimeMillis() - start,
probed
);
}
}
Expand All @@ -159,6 +162,7 @@ public void exec() throws IOException {
* @throws FileNotFoundException If not found
*/
private Collection<ObjectName> probes(final Path file) throws FileNotFoundException {
final long start = System.currentTimeMillis();
final Collection<ObjectName> objects = new ListOf<>(
new Mapped<>(
obj -> new OnCached(
Expand All @@ -183,8 +187,10 @@ private Collection<ObjectName> probes(final Path file) throws FileNotFoundExcept
} else {
Logger.debug(
this,
"Found %d probed objects in %[file]s: %s",
objects.size(), file, objects
"Found %d probed objects in %[file]s in %[ms]s: %s",
objects.size(), file,
System.currentTimeMillis() - start,
objects
);
}
return objects;
Expand Down

0 comments on commit 389dd3e

Please sign in to comment.