yzhangal commented on code in PR #641:
URL: https://github.com/apache/yunikorn-core/pull/641#discussion_r1388982086


##########
pkg/metrics/queue.go:
##########
@@ -72,70 +92,89 @@ func InitQueueMetrics(name string) CoreQueueMetrics {
 }
 
 func (m *QueueMetrics) Reset() {
-       m.appMetrics.Reset()
-       m.ResourceMetrics.Reset()
+       m.appMetricsLabel.Reset()
+       m.appMetricsSubsystem.Reset()
+       m.ResourceMetricsLabel.Reset()
+       m.ResourceMetricsSubsystem.Reset()
 }
 
 func (m *QueueMetrics) IncQueueApplicationsRunning() {

Review Comment:
   Thanks for working on this nice improvement @WilliamTom 
   
   It seems we can introduce a comment set of methods, and share them with 
different metrics:
   func (m *QueueMetrics) incMetrics(metrics string) {
        m.appMetricsLabel.With(prometheus.Labels{"state": metrics}).Inc()
        m.appMetricsSubsystem.With(prometheus.Labels{"state": metrics}).Inc()
   }
   func (m *QueueMetrics) decMetrics(metrics string) {
        m.appMetricsLabel.With(prometheus.Labels{"state": metrics}).Dec()
        m.appMetricsSubsystem.With(prometheus.Labels{"state": metrics}).Dec()
   }
   func (m *QueueMetrics) setMetrics(metrics string) {
   }
   func (m *QueueMetrics) addMetrics(metrics string) {
   }
   
   func (m *QueueMetrics) IncQueueApplicationsRunning() {
       m.incrMetrics("running")
   }
   ...
   
   



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