tianxiaoliang commented on a change in pull request #1165:
URL: 
https://github.com/apache/servicecomb-service-center/pull/1165#discussion_r744077370



##########
File path: server/metrics/meta_reporter.go
##########
@@ -64,6 +78,16 @@ func (m *MetaReporter) InstanceAdd(delta float64, ml 
datasource.MetricsLabels) {
                log.Error("gauge add failed", err)
        }
 }
+func (m *MetaReporter) InstanceUsageSet() {
+       instance := metricsvc.InstanceName()
+       labels := map[string]string{
+               "instance": instance,
+       }
+       used := promutil.GaugeValue(KeyInstanceTotal, labels)
+       if err := metrics.GaugeSet(KeyInstanceUsage, 
used/float64(quota.DefaultInstanceQuota), labels); err != nil {

Review comment:
       判断0

##########
File path: server/metrics/meta_reporter.go
##########
@@ -51,6 +55,16 @@ func (m *MetaReporter) ServiceAdd(delta float64, ml 
datasource.MetricsLabels) {
                log.Error("gauge add failed", err)
        }
 }
+func (m *MetaReporter) ServiceUsageSet() {
+       instance := metricsvc.InstanceName()
+       labels := map[string]string{
+               "instance": instance,
+       }
+       used := promutil.GaugeValue(KeyServiceTotal, labels)
+       if err := metrics.GaugeSet(KeyServiceUsage, 
used/float64(quota.DefaultServiceQuota), labels); err != nil {

Review comment:
       判断下0




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