Skip to content

Commit 1ed1b0e

Browse files
committed
Log metrics for recovery
1 parent 7f26b21 commit 1ed1b0e

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

src/main/java/com/github/dexecutor/core/DefaultDexecutor.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,11 +112,19 @@ public ExecutionResults<T, R> recoverExecution(final ExecutionConfig config) {
112112
} else {
113113
logger.debug("Recovering Dexecutor.");
114114
this.state.onRecover();
115+
long start = new Date().getTime();
115116
doWaitForExecution(config);
116117
doExecute(this.state.getNonProcessedRootNodes(), config);
117118
doWaitForExecution(config);
119+
shutdownExecutors();
120+
121+
long end = new Date().getTime();
122+
123+
this.state.setCurrentPhase(Phase.TERMINATED);
118124
this.state.onTerminate();
119-
logger.debug("Processed Nodes Ordering {}", this.state.getProcessedNodes());
125+
126+
logger.debug("Total Time taken to process {} jobs is {} ms, after recovery", this.state.graphSize(), end - start);
127+
logger.debug("Processed Nodes Ordering, after recovery {}", this.state.getProcessedNodes());
120128
}
121129
return this.state.getExecutionResults();
122130
}

src/test/java/com/github/dexecutor/core/DexecutorPauseAndRecover.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public void testDependentTaskExecution() {
5555
@Override
5656
protected boolean shouldContinueProcessingNodes() {
5757
counter++;
58-
return counter != 2;
58+
return counter != 3;
5959
}
6060
};
6161

0 commit comments

Comments
 (0)