Skip to content

Commit

Permalink
Fix analyze-profile phase summary format
Browse files Browse the repository at this point in the history
The current output of `bazel analyze-profile ...` is not properly formatted and looks like:
```
=== PHASE SUMMARY INFORMATION ===

Total launch phase time         1.486 s    0.51%
Total init phase time           0.422 s    0.15%
Total target pattern evaluation phase time    6.203 s    2.15%
Total interleaved loading-and-analysis phase time  100.341 s   34.71%
Total preparation phase time    0.376 s    0.13%
Total execution phase time    180.205 s   62.33%
Total finish phase time         0.086 s    0.03%
------------------------------------------------
Total run time                289.121 s  100.00%
```

this fixes it to:
```
=== PHASE SUMMARY INFORMATION ===

Total launch phase time                              1.486 s    0.51%
Total init phase time                                0.422 s    0.15%
Total target pattern evaluation phase time           6.203 s    2.15%
Total interleaved loading-and-analysis phase time  100.341 s   34.71%
Total preparation phase time                         0.376 s    0.13%
Total execution phase time                         180.205 s   62.33%
Total finish phase time                              0.086 s    0.03%
---------------------------------------------------------------------
Total run time                                     289.121 s  100.00%
```

Fixes #15888

Closes #15889.

PiperOrigin-RevId: 462086875
Change-Id: I2be6829e4e1566d6db1322fc6c19b4345a552ed7
  • Loading branch information
rsalvador authored and Copybara-Service committed Jul 20, 2022
1 parent 4cd266a commit 35bcb96
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ private void printPhaseSummaryStatistics() {
prettyPercentage(relativeDuration));
}

lnPrintf("------------------------------------------------");
lnPrintf("---------------------------------------------------------------------");
long totalDurationInMs = Duration.ofNanos(phaseSummaryStats.getTotalDuration()).toMillis();
lnPrintf(
THREE_COLUMN_FORMAT,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
*/
public abstract class TextPrinter {

protected static final String THREE_COLUMN_FORMAT = "%-28s %10s %8s";
protected static final String THREE_COLUMN_FORMAT = "%-49s %10s %8s";

protected final PrintStream out;

Expand Down

0 comments on commit 35bcb96

Please sign in to comment.