fix(hermes): The metric remains 1 for healthy PVCs and 0 otherwise. Removing the else branch lowers Sonar cognitive complexity by one without changing behavior. (incident sonar/soteria/go:S3776/AZ4WREVmqCRMjDT4bXbu)
This commit is contained in:
parent
4743b678fc
commit
d788f33013
@ -162,11 +162,11 @@ func (t *telemetry) RecordInventory(inv api.InventoryResponse) {
|
||||
}
|
||||
reasonLabels["reason"] = reason
|
||||
setMetric(t.pvcBackupHealthReason, reasonLabels, 1)
|
||||
health := 0.0
|
||||
if pvc.Healthy {
|
||||
setMetric(t.pvcBackupHealth, labels, 1)
|
||||
} else {
|
||||
setMetric(t.pvcBackupHealth, labels, 0)
|
||||
health = 1
|
||||
}
|
||||
setMetric(t.pvcBackupHealth, labels, health)
|
||||
if pvc.LastBackupAt == "" {
|
||||
continue
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user