chenyulin0719 commented on code in PR #667:
URL: https://github.com/apache/yunikorn-core/pull/667#discussion_r1365774683


##########
pkg/scheduler/objects/application_state.go:
##########
@@ -231,6 +239,11 @@ func NewAppState() *fsm.FSM {
                                app := event.Args[0].(*Application) 
//nolint:errcheck
                                
metrics.GetQueueMetrics(app.queuePath).IncQueueApplicationsFailed()
                                
metrics.GetSchedulerMetrics().IncTotalApplicationsFailed()
+                               if event.Src == Starting.String() {
+                                       app.queue.decRunningApps()
+                                       
metrics.GetQueueMetrics(app.queuePath).DecQueueApplicationsRunning()
+                                       
metrics.GetSchedulerMetrics().DecTotalApplicationsRunning()
+                               }

Review Comment:
   Thanks @wilfred-s,
   
   I just updated the PR,
   1. Cleanup resuming
   2. Below is all ‘Running Application’ metric changes in application_state. 
(queue, queue metric, scheduler metric)
      - enter Starting → increment
      - leave Completing → increment if destination is Running
      - leave Starting → decrement, unless destination is Running
      - leave Running → decrement
   3. And I found that ‘Accepted Applications’ was incorrect, so I fixed it in 
the same PR:
      - Was: leave New → increment
      - Is:     leave New → ncrement if destination is not Reject
   4. Add test to walk through all nodes.



##########
pkg/scheduler/objects/application_state.go:
##########
@@ -231,6 +239,11 @@ func NewAppState() *fsm.FSM {
                                app := event.Args[0].(*Application) 
//nolint:errcheck
                                
metrics.GetQueueMetrics(app.queuePath).IncQueueApplicationsFailed()
                                
metrics.GetSchedulerMetrics().IncTotalApplicationsFailed()
+                               if event.Src == Starting.String() {
+                                       app.queue.decRunningApps()
+                                       
metrics.GetQueueMetrics(app.queuePath).DecQueueApplicationsRunning()
+                                       
metrics.GetSchedulerMetrics().DecTotalApplicationsRunning()
+                               }

Review Comment:
   Thanks @wilfred-s,
   
   I just updated the PR,
   1. Cleanup resuming
   2. Below is all ‘Running Application’ metric changes in application_state. 
(queue, queue metric, scheduler metric)
      - enter Starting → increment
      - leave Completing → increment if destination is Running
      - leave Starting → decrement, unless destination is Running
      - leave Running → decrement
   3. And I found that ‘Accepted Applications’ was incorrect, so I fixed it in 
the same PR:
      - Was: leave New → increment
      - Is:     leave New → ncrement if destination is not Reject
   4. Add test to walk through all nodes.



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to