Skip to content

Commit

Permalink
Import progress highlights new internal stages
Browse files Browse the repository at this point in the history
By printing a dash instead of a dot in the progress.
This can help understand changes in timings between different
parts of each import stage "group".
  • Loading branch information
tinwelint committed Jul 31, 2018
1 parent 487caf4 commit b0f71a0
Showing 1 changed file with 10 additions and 2 deletions.
Expand Up @@ -90,11 +90,11 @@ enum ImportStage
private static final int DOT_GROUPS_PER_LINE = 5;
private static final int PERCENTAGES_PER_LINE = 5;

// assigned later on
private final PrintStream out;
private final Monitor monitor;
private final ExternalMonitor externalMonitor;
private DependencyResolver dependencyResolver;
private boolean newInternalStage;

// progress of current stage
private long goal;
Expand Down Expand Up @@ -209,6 +209,7 @@ else if ( includeStage( execution ) )
{
stashedProgress += progress;
progress = 0;
newInternalStage = true;
}
lastReportTime = currentTimeMillis();
}
Expand Down Expand Up @@ -302,6 +303,7 @@ private void initializeProgress( long goal, ImportStage stage )
this.stashedProgress = 0;
this.progress = 0;
this.currentStage = stage;
this.newInternalStage = false;
}

private void updateProgress( long progress )
Expand Down Expand Up @@ -368,7 +370,13 @@ private void printDots( int from, int target )
{
out.print( ' ' );
}
out.print( '.' );
char dotChar = '.';
if ( newInternalStage )
{
newInternalStage = false;
dotChar = '-';
}
out.print( dotChar );
current++;
}
}
Expand Down

0 comments on commit b0f71a0

Please sign in to comment.