zhuzhurk commented on a change in pull request #10082: [FLINK-14164][runtime] 
Add a counter ‘numberOfRestarts’ to show number of restarts
URL: https://github.com/apache/flink/pull/10082#discussion_r343515851
 
 

 ##########
 File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/scheduler/SchedulerBase.java
 ##########
 @@ -193,6 +197,10 @@ public SchedulerBase(
                this.failoverTopology = executionGraph.getFailoverTopology();
 
                this.inputsLocationsRetriever = new 
ExecutionGraphToInputsLocationsRetrieverAdapter(executionGraph);
+
+               this.numberOfRestartsCounter = new SimpleCounter();
+               jobManagerJobMetricGroup.counter(NUMBER_OF_RESTARTS, 
numberOfRestartsCounter);
+               
executionGraph.setNumberOfRestartsCounter(numberOfRestartsCounter);
 
 Review comment:
   I can think of no clean way to do it in SchedulerBase constructor.
   However, we can do it in each scheduler implementation. I have updated the 
PR is that way.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to