zhuqi-lucas commented on code in PR #968:
URL: https://github.com/apache/yunikorn-core/pull/968#discussion_r1762197209


##########
pkg/scheduler/objects/application.go:
##########
@@ -191,13 +190,15 @@ func NewApplication(siApp *si.AddApplicationRequest, ugi 
security.UserGroup, eve
        app.rmID = rmID
        app.appEvents = schedEvt.NewApplicationEvents(events.GetEventSystem())
        app.appEvents.SendNewApplicationEvent(app.ApplicationID)
-       app.setNewMetrics()
        return app
 }
 
-func (sa *Application) setNewMetrics() {
-       metrics.GetSchedulerMetrics().IncTotalApplicationsNew()
-       metrics.GetQueueMetrics(sa.GetQueuePath()).IncQueueApplicationsNew()
+func (sa *Application) SetNewMetrics() {
+       // ensure the queue is set before calling this function
+       if sa.GetQueuePath() != "" {

Review Comment:
   Thanks @craigcondit , good suggestion, addressed in latest PR.



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