浏览代码

fix INF on unallocated

Ajay Tripathy 6 年之前
父节点
当前提交
5d3a5724cf
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      pkg/costmodel/metrics.go

+ 1 - 1
pkg/costmodel/metrics.go

@@ -525,7 +525,7 @@ func StartCostModelMetricRecording(a *Accesses) bool {
 							if timesClaimed == 0 {
 							if timesClaimed == 0 {
 								timesClaimed = 1 // unallocated PVs are unclaimed but have a full allocation
 								timesClaimed = 1 // unallocated PVs are unclaimed but have a full allocation
 							}
 							}
-							a.PVAllocationRecorder.WithLabelValues(namespace, podName, pvc.Claim, pvc.VolumeName).Set(pvc.Values[0].Value / float64(pvc.TimesClaimed))
+							a.PVAllocationRecorder.WithLabelValues(namespace, podName, pvc.Claim, pvc.VolumeName).Set(pvc.Values[0].Value / float64(timesClaimed))
 							labelKey := getKeyFromLabelStrings(namespace, podName, pvc.Claim, pvc.VolumeName)
 							labelKey := getKeyFromLabelStrings(namespace, podName, pvc.Claim, pvc.VolumeName)
 							pvcSeen[labelKey] = true
 							pvcSeen[labelKey] = true
 						}
 						}