Skip to content

Commit

Permalink
[PEx] parallel: minor change
Browse files Browse the repository at this point in the history
  • Loading branch information
aman-goel committed Aug 29, 2024
1 parent 75cd3cc commit 9a561c7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ private static void runWithTimeout() throws Exception {
TimeUnit.SECONDS.sleep(1);
PExGlobal.printProgress(false);
}
PExGlobal.printProgress(true);
PExGlobal.printProgressFooter();

if (resultException != null) {
throw resultException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,6 @@ public static void updateResult() {
}

public static void recordStats() {
printProgress(true);

// print basic statistics
StatWriter.log("#-schedules", String.format("%d", getTotalSchedules()));
StatWriter.log("#-timelines", String.format("%d", timelines.size()));
Expand Down Expand Up @@ -278,6 +276,10 @@ public static void printProgressHeader() {
System.out.println(s);
}

public static void printProgressFooter() {
System.out.println();
}

public static void printProgress(boolean forcePrint) {
if (forcePrint || (TimeMonitor.findInterval(lastReportTime) > 10)) {
lastReportTime = Instant.now();
Expand Down Expand Up @@ -312,11 +314,7 @@ public static void printProgress(boolean forcePrint) {
s.append(StringUtils.center(String.format("%d", stateCache.size()), 12));
}

if (forcePrint) {
System.out.println(s);
} else {
System.out.print(s);
}
System.out.print(s);
}
}

Expand Down

0 comments on commit 9a561c7

Please sign in to comment.