@@ -123,6 +123,8 @@ public class ProgressReporter {
123123 public static final String DOCS_BASE_URL = "https://github.com/oracle/graal/blob/master/docs/reference-manual/native-image/BuildOutput.md" ;
124124 private static final double EXCESSIVE_GC_MIN_THRESHOLD_MILLIS = TimeUtils .secondsToMillis (15 );
125125 private static final double EXCESSIVE_GC_RATIO = 0.5 ;
126+ // Use a leading space like in the rest of Native Image output
127+ private static final String BYTES_TO_HUMAN_FORMAT = " " + ByteFormattingUtil .RIGHT_ALIGNED_FORMAT ;
126128
127129 private final NativeImageSystemIOWrappers builderIO ;
128130
@@ -598,7 +600,7 @@ public void printCreationEnd(int imageFileSize, int heapObjectCount, long imageH
598600 Timer archiveTimer = getTimer (TimerCollection .Registry .ARCHIVE_LAYER );
599601 stagePrinter .end (imageTimer .getTotalTime () + writeTimer .getTotalTime () + archiveTimer .getTotalTime ());
600602 creationStageEndCompleted = true ;
601- String format = "%9s (%5.2f%%) for " ;
603+ String format = BYTES_TO_HUMAN_FORMAT + " (%5.2f%%) for " ;
602604 l ().a (format , ByteFormattingUtil .bytesToHuman (codeAreaSize ), ProgressReporterUtils .toPercentage (codeAreaSize , imageFileSize ))
603605 .doclink ("code area" , "#glossary-code-area" ).a (":%,10d compilation units" , numCompilations ).println ();
604606 int numResources = 0 ;
@@ -632,7 +634,7 @@ public void printCreationEnd(int imageFileSize, int heapObjectCount, long imageH
632634 recordJsonMetric (ImageDetailKey .NUM_COMP_UNITS , numCompilations );
633635 l ().a (format , ByteFormattingUtil .bytesToHuman (otherBytes ), ProgressReporterUtils .toPercentage (otherBytes , imageFileSize ))
634636 .doclink ("other data" , "#glossary-other-data" ).println ();
635- l ().a ("%9s in total image size" , ByteFormattingUtil .bytesToHuman (imageFileSize ));
637+ l ().a (BYTES_TO_HUMAN_FORMAT + " in total image size" , ByteFormattingUtil .bytesToHuman (imageFileSize ));
636638 if (imageDiskFileSize >= 0 ) {
637639 l ().a (", %s in total file size" , ByteFormattingUtil .bytesToHuman (imageDiskFileSize ));
638640 }
@@ -723,14 +725,15 @@ private void printBreakdowns() {
723725 int numHeapItems = heapBreakdown .getSortedBreakdownEntries ().size ();
724726 long totalCodeBytes = codeBreakdown .values ().stream ().mapToLong (Long ::longValue ).sum ();
725727
726- p .l ().a (String .format ("%9s for %s more packages" , ByteFormattingUtil .bytesToHuman (totalCodeBytes - printedCodeBytes ), numCodeItems - printedCodeItems ))
728+ p .l ().a (String .format (BYTES_TO_HUMAN_FORMAT + " for %s more packages" , ByteFormattingUtil .bytesToHuman (totalCodeBytes - printedCodeBytes ), numCodeItems - printedCodeItems ))
727729 .jumpToMiddle ()
728- .a (String .format ("%9s for %s more object types" , ByteFormattingUtil .bytesToHuman (heapBreakdown .getTotalHeapSize () - printedHeapBytes ), numHeapItems - printedHeapItems ))
730+ .a (String .format (BYTES_TO_HUMAN_FORMAT + " for %s more object types" , ByteFormattingUtil .bytesToHuman (heapBreakdown .getTotalHeapSize () - printedHeapBytes ),
731+ numHeapItems - printedHeapItems ))
729732 .flushln ();
730733 }
731734
732735 private static String getBreakdownSizeString (long sizeInBytes ) {
733- return String .format ("%9s " , ByteFormattingUtil .bytesToHuman (sizeInBytes ));
736+ return String .format (BYTES_TO_HUMAN_FORMAT + " " , ByteFormattingUtil .bytesToHuman (sizeInBytes ));
734737 }
735738
736739 private void printRecommendations () {
0 commit comments