Skip to content

Commit

Permalink
Added "c" command to print only current stage details
Browse files Browse the repository at this point in the history
  • Loading branch information
tinwelint committed Dec 4, 2017
1 parent 6e328e9 commit 7c72879
Showing 1 changed file with 16 additions and 1 deletion.
Expand Up @@ -78,6 +78,7 @@ public OnDemandDetailsExecutionMonitor( PrintStream out )
{
this.out = out;
this.actions.put( "i", Pair.of( "Print more detailed information", this::printDetails ) );
this.actions.put( "c", Pair.of( "Print more detailed information about current stage", this::printDetailsForCurrentStage ) );
this.actions.put( "gc", Pair.of( "Trigger GC", this::triggerGC ) );
this.gcMonitor = new MeasureDoNothing( "Importer GC monitor", gcBlockTime, 100, 200 );
}
Expand Down Expand Up @@ -128,7 +129,7 @@ public void check( StageExecution execution )

private void printDetails()
{
out.println( format( "%n************** DETAILS **************%n" ) );
printDetailsHeadline();
for ( StageDetails stageDetails : details )
{
stageDetails.print( out );
Expand All @@ -139,6 +140,20 @@ private void printDetails()
out.println( " Max VM memory: " + bytes( Runtime.getRuntime().maxMemory() ) );
out.println( " Free VM memory: " + bytes( Runtime.getRuntime().freeMemory() ) );
out.println( " GC block time: " + duration( gcBlockTime.getGcBlockTime() ) );
}

private void printDetailsForCurrentStage()
{
printDetailsHeadline();
if ( !details.isEmpty() )
{
details.get( details.size() - 1 ).print( out );
}
}

private void printDetailsHeadline()
{
out.println( format( "%n************** DETAILS **************%n" ) );

// Make sure that if user is interested in details then also print the entire details set when import is done
printDetailsOnDone = true;
Expand Down

0 comments on commit 7c72879

Please sign in to comment.