fixed component and cluster metrics

This commit is contained in:
Carman Zhang
2018-11-16 10:59:11 +08:00
parent 066f36b81f
commit c5d9da99a1
4 changed files with 116 additions and 143 deletions

View File

@@ -895,7 +895,7 @@ func MonitorComponentStatus(monitoringRequest *client.MonitoringRequestParams) *
for _, nsStatusItem := range nsStatus.(map[string]interface{}) {
component := nsStatusItem.(models.Component)
namspaceComponentTotalMap[ns] += 1
if component.HealthyBackends == component.TotalBackends {
if component.HealthyBackends != 0 && component.HealthyBackends == component.TotalBackends {
namspaceComponentHealthyMap[ns] += 1
}
}