wilfred-s commented on code in PR #667:
URL: https://github.com/apache/yunikorn-core/pull/667#discussion_r1363322114
##########
pkg/scheduler/objects/application_state.go:
##########
@@ -205,6 +205,14 @@ func NewAppState() *fsm.FSM {
app.rejectedMessage =
event.Args[1].(string) //nolint:errcheck
}
},
+ fmt.Sprintf("enter_%s", Running.String()): func(_
context.Context, event *fsm.Event) {
Review Comment:
This counts apps twice: Starting increased the value and now again in Running
##########
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:
We should track this from the Starting state. We are not tracking the
metrics in the same way for different state entries or exits. Makes it
difficult to comprehend what we do
--
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]