yuchaoran2011 commented on a change in pull request #352:
URL: 
https://github.com/apache/incubator-yunikorn-core/pull/352#discussion_r774841198



##########
File path: pkg/metrics/queue.go
##########
@@ -28,60 +28,38 @@ import (
        "github.com/apache/incubator-yunikorn-core/pkg/log"
 )
 
+// QueueMetrics to declare queue metrics
 type QueueMetrics struct {
-       // metrics related to app
-       appMetrics *prometheus.CounterVec
-
-       // metrics related to resource
-       usedResourceMetrics      *prometheus.GaugeVec
-       pendingResourceMetrics   *prometheus.GaugeVec
-       availableResourceMetrics *prometheus.GaugeVec
+       appMetrics      *prometheus.GaugeVec

Review comment:
       This should be a CounterVec

##########
File path: pkg/metrics/queue.go
##########
@@ -28,60 +28,38 @@ import (
        "github.com/apache/incubator-yunikorn-core/pkg/log"
 )
 
+// QueueMetrics to declare queue metrics
 type QueueMetrics struct {
-       // metrics related to app
-       appMetrics *prometheus.CounterVec
-
-       // metrics related to resource
-       usedResourceMetrics      *prometheus.GaugeVec
-       pendingResourceMetrics   *prometheus.GaugeVec
-       availableResourceMetrics *prometheus.GaugeVec
+       appMetrics      *prometheus.GaugeVec
+       ResourceMetrics *prometheus.GaugeVec
 }
 
-func forQueue(name string) CoreQueueMetrics {
+// InitQueueMetrics to initialize queue metrics
+func InitQueueMetrics(name string) CoreQueueMetrics {
        q := &QueueMetrics{}
 
-       // Queue Metrics
-       q.appMetrics = prometheus.NewCounterVec(
-               prometheus.CounterOpts{
-                       Namespace: Namespace,
-                       Subsystem: substituteQueueName(name),
-                       Name:      "app_metrics",
-                       Help:      "Application Metrics",
-               }, []string{"state"})
-
-       q.usedResourceMetrics = prometheus.NewGaugeVec(
-               prometheus.GaugeOpts{
-                       Namespace: Namespace,
-                       Subsystem: substituteQueueName(name),
-                       Name:      "used_resource",
-                       Help:      "Queue used resource",
-               }, []string{"resource"})
-
-       q.pendingResourceMetrics = prometheus.NewGaugeVec(
+       q.appMetrics = prometheus.NewGaugeVec(
                prometheus.GaugeOpts{
                        Namespace: Namespace,
                        Subsystem: substituteQueueName(name),
-                       Name:      "pending_resource",
-                       Help:      "Queue pending resource",
-               }, []string{"resource"})
+                       Name:      "queue_app",
+                       Help:      "Queue application metrics. State of the 
application includes `running`.",
+               }, []string{"state"})

Review comment:
       Looks like other states like `accepted`, `rejected` and `completed` got 
removed and only `running` is retained. We should keep the other states too




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